With SET OPTIMIZE OFF, I created a small dbf table (no index) with 1000 records to test the speed of LOCATE command in both X# and VFP.
I iterate a "locate" command in a "for loop" statement so I can obtain a proper measurement. I run the code below in both X# and VFP:
Code: Select all
RddSetDefault("DBFVFP")
SET EXCLUSIVE OFF
LOCAL lnSERIES
? "Start: " + Time()
USE "C:TEMPTemp.DBF" SHARED
SELECT TEMP
GO TOP
FOR lnSERIES = 1 TO 1000
LOCATE FOR SERIES = lnSERIES
NEXT
? " End: " + Time()
WAIT
RETURN
Code: Select all
Start: 21:18:09
End: 21:18:17
///// elapse time is -----> 8 Seconds?????
Code: Select all
Start: 21:18:09
End: 21:18:09
///// elapse time is way less than 1 second (??ms)