DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C++ (http://www.daniweb.com/forums/forum8.html)
-   -   pausing a command (http://www.daniweb.com/forums/thread4825.html)

Bleek Mar 21st, 2004 11:01 pm
pausing a command
 
how do u pause a command in c++? i know how to pause using system("pause") or cin.get() but i want to know hot to make the program sleep for a certain ammount of time... like vbs' wscript.sleep 1000... if that helps

thanx

infamous Mar 23rd, 2004 1:58 pm
Re: pausing a command
 
linux: sleep() or usleep() #include <unistd.h>
windows: Sleep() #include <time.h>

Bleek Mar 31st, 2004 5:52 pm
Re: pausing a command
 
I'm really sorry about bringing this up again but the Sleep(); function isnt working for me. i included ctime. could someone give me an example of code for this that works? (I'm using the dev-cpp bloodshed compiler)

thanx...

infamous Mar 31st, 2004 7:19 pm
Re: pausing a command
 
http://msdn.microsoft.com/library/de...base/sleep.asp

i may have given wrong header, sorry.

Phaelax Apr 1st, 2004 3:03 pm
Re: pausing a command
 
ctime.h possibly?

infamous Apr 1st, 2004 3:37 pm
Re: pausing a command
 
that msdn crud says 'windows.h', but i was sure u didnt need to include all that garbage just for sleep...

Aaerox Apr 2nd, 2004 11:29 am
Re: pausing a command
 
Sleep is a kernel32.dll function. All exports of kernel32.dll are typically associated with windows.h.

BountyX Apr 3rd, 2004 11:14 pm
Re: pausing a command
 
Quote:

Originally Posted by infamous
that msdn crud says 'windows.h', but i was sure u didnt need to include all that garbage just for sleep...

#define WIN32_LEAN_AND_MEAN
#incldue <windows.h>

that cuts the crud a little ;)


All times are GMT -4. The time now is 9:30 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC