954,124 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

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

Bleek
Light Poster
28 posts since Mar 2004
Reputation Points: 45
Solved Threads: 0
 

linux: sleep() or usleep() #include
windows: Sleep() #include

infamous
Junior Poster in Training
77 posts since Mar 2004
Reputation Points: 47
Solved Threads: 2
 

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...

Bleek
Light Poster
28 posts since Mar 2004
Reputation Points: 45
Solved Threads: 0
 
infamous
Junior Poster in Training
77 posts since Mar 2004
Reputation Points: 47
Solved Threads: 2
 

ctime.h possibly?

Phaelax
Practically a Posting Shark
858 posts since Mar 2004
Reputation Points: 92
Solved Threads: 51
 

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

infamous
Junior Poster in Training
77 posts since Mar 2004
Reputation Points: 47
Solved Threads: 2
 

Sleep is a kernel32.dll function. All exports of kernel32.dll are typically associated with windows.h.

Aaerox
Newbie Poster
8 posts since Mar 2004
Reputation Points: 10
Solved Threads: 1
 
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

that cuts the crud a little ;)

BountyX
Posting Whiz in Training
230 posts since Mar 2004
Reputation Points: 28
Solved Threads: 9
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You