delay example?

Blitz3D Forums/Blitz3D Beginners Area/delay example?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Here you go:
;outside of main loop
delayTime=1500 ; 1 1/2 secs
time_to_wait=millisecs()+delayTime ; use 0 for no initial delay

;in main loop
if millisecs()>=time_to_wait

 doThings()
 time_to_wait=millisecs()+delayTime

end if


Have fun.