1st loop checks machine's speed, to get number of loops in 1 sec. 2nd loop runs DO routine for 1/1000 of that time.
Dummy lines are to keep the contents of the loop equal.
'test machine speed
n&=0: b&=0: t!= TIMER
DO
IF TIMER>=t! + 1 THEN EXIT DO
n& = n& + 1 'count
IF n& = b& THEN EXIT DO 'dummy
LOOP
ms& = n&/1000
CALL millisec(ms&)
SUB millisec(ms&) 'loop for 1 millsec
n& = 0 : t! = TIMER
DO
IF TIMER >= t! + 100 THEN EXIT DO 'dummy
n& = n& + 1
IF n& = ms& THEN EXIT DO
LOOP
END SUB
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.