waittimer(time)

Blitz3D Forums/Blitz3D Programming/waittimer(time)

Rook Zimbabwe(Posted 2004) [#1]
I don't seem to notice any appreciable lag in my program using waittimer(time) if:
while not keyhit(1)
time=createtimer(1000)
waittimmer(time)
wend

I just want to slow my program down enough for people to see that the game really is clearing the spaces from the board...

I am running Athlon64 3200+ with 1 gig RAM and ATi 9000 vidcard... Is it me???


-RZ


BlackTower(Posted 2004) [#2]
The parameter for CreateTimer is the amount of FPS you want to have as a maximum for your app.

Const MAX_FPS% = 60

Global mmFrame = CreateTimer(MAX_FPS)

While (Not (KeyHit(1)))
  WaitTimer(mmFrame)
Wend

FreeTimer mmFrame


If you want to have a framerate of 60 fps, use the code above.


Rook Zimbabwe(Posted 2004) [#3]
so 1000 wouldn't be a good idea then...

How do I put in a small (1/4 sec) lag???

-RZ


Cancerian(Posted 2004) [#4]
Wouldn't a quarter second delay be:

Delay 250

But that will suspend your whole program for a quarter second. You won't be able to do any other calculations in the background.


WolRon(Posted 2004) [#5]
A simple
Delay 250
will do what you want, but note that NOTHING will happen for the 1/4 second delay.
If this is not what you want, then you will have to use the Millisecs() command
starttimedelay = Millisecs()
to record the current milliseconds when you want the delay to start. Once this check
If starttimedelay + 250 > Millisecs()
is true then you can proceed with the next step in your animation.