'Speed' of loop

BlitzMax Forums/BlitzMax Beginners Area/'Speed' of loop

One option:

Use an incremental coutner variable, and do something like this:

while not keydown(key_escape)
   if variable mod 10 = 0 then
       variable=1
       ' Do your stuff
   end if
   variable = variable +1
   flip
wend


That way the 'do stuff' portion only gets invoked every 10th loop.

You could also create a timer, and if the timer gets triggered invoke your function.