Skip to main content
GameDev.net gamedev.net
🔒 Locked

Wait command in c++??

Started by dragov Apr 19, 2003 at 8:10 AM 6 replies 44k views
Original Post
dragov
dragov
What is the wait command in c++?? ~-~-~-~-~-~-~-~-~ Butterfly Corp
_Corrupt_
_Corrupt_
sleep( time );
don''t piss on an electrical fence
dragov
dragov
Thank you for you fast answer!

~-~-~-~-~-~-~-~-~
Butterfly Corp
Pipo DeClown
Pipo DeClown
quote:
Original post by _Corrupt_
sleep( time );


sleep( milliseconds ) ;


.lick
_Corrupt_
_Corrupt_
hmmmm

i thought it was like this:

sleep( seconds )

and

Sleep( milliseconds ) <- needs windows.h

Could be wrong though
don''t piss on an electrical fence
BaZiL
BaZiL

   i thought ill just post something here, im bored again   
Yes stuff does do stuff... i dunno
Lektrix
Lektrix
I would suggest something like:


#include <windows.h>    // you must include windows.h to use Sleep()
inline void Wait(int seconds)
{
    Sleep(seconds * 1000);
}


You can create other functions, if necessary, to make your code neater for Sleep() - for example:

WaitSecs(), WaitMins(), WaitHrs(), etc.

[ Google || Start Here || ACCU || MSDN || STL || GameCoding || BarrysWorld || E-Mail Me ]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.