943,884 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 16706
  • C++ RSS
Mar 21st, 2004
1

pausing a command

Expand Post »
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
Similar Threads
Reputation Points: 45
Solved Threads: 0
Light Poster
Bleek is offline Offline
28 posts
since Mar 2004
Mar 23rd, 2004
0

Re: pausing a command

linux: sleep() or usleep() #include <unistd.h>
windows: Sleep() #include <time.h>
Reputation Points: 47
Solved Threads: 2
Junior Poster in Training
infamous is offline Offline
77 posts
since Mar 2004
Mar 31st, 2004
0

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...
Reputation Points: 45
Solved Threads: 0
Light Poster
Bleek is offline Offline
28 posts
since Mar 2004
Mar 31st, 2004
0

Re: pausing a command

http://msdn.microsoft.com/library/de...base/sleep.asp

i may have given wrong header, sorry.
Reputation Points: 47
Solved Threads: 2
Junior Poster in Training
infamous is offline Offline
77 posts
since Mar 2004
Apr 1st, 2004
0

Re: pausing a command

ctime.h possibly?
Reputation Points: 92
Solved Threads: 51
Practically a Posting Shark
Phaelax is offline Offline
856 posts
since Mar 2004
Apr 1st, 2004
0

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...
Reputation Points: 47
Solved Threads: 2
Junior Poster in Training
infamous is offline Offline
77 posts
since Mar 2004
Apr 2nd, 2004
0

Re: pausing a command

Sleep is a kernel32.dll function. All exports of kernel32.dll are typically associated with windows.h.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
Aaerox is offline Offline
8 posts
since Mar 2004
Apr 3rd, 2004
0

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
Reputation Points: 28
Solved Threads: 9
Posting Whiz in Training
BountyX is offline Offline
222 posts
since Mar 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Telnet Automation How to?
Next Thread in C++ Forum Timeline: Help Me on Symbian(OS) Programming with c++





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC