mjcmkrsr
Technical User
- Nov 30, 2010
- 830
Hi,
I tested SYS(2015) with 1'000'000 records created in 540 milliseconds ( ~ 1850 values per millisecond) and NO duplicates were found (see code below). According to the Help file, records created during the same millisecond would be identical. Hence my question: is SYS(2015) generating unique values?
MarK
I tested SYS(2015) with 1'000'000 records created in 540 milliseconds ( ~ 1850 values per millisecond) and NO duplicates were found (see code below). According to the Help file, records created during the same millisecond would be identical. Hence my question: is SYS(2015) generating unique values?
Code:
CLOSE ALL
LOCAL liStart, liEnd
CREATE CURSOR csrPKey (cSys2015 C(10))
liStart = SECONDS()
FOR i = 1 TO 1000000
INSERT INTO csrPKey (cSys2015) VALUES (SYS(2015))
ENDFOR
liEnd = SECONDS()
WAIT WINDOW + STR((liEnd - liStart) * 1000) TIMEOUT 3
BROWSE
select * FROM csrPKey ;
GROUP BY 1 ;
HAVING COUNT(cSys2015) > 1 ;
INTO CURSOR csrDupes
IF _tally > 0
BROWSE
ELSE
WAIT WINDOW "No duplicates found!" TIMEOUT 3
ENDIF
CLOSE ALL
CLEAR ALL
MarK