Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

equivalent to sleep command in C

Status
Not open for further replies.

ahsanamin

Programmer
Jun 14, 2002
3
US
Hi,
I want to add a delay in my program between two fuctions. Say 5 secconds. In unix I use sleep() command to do this. What can I use in C. I would appreciate if someone can help.
Thanks
Ahsan
 
Hi:

In "C" it's also sleep:

sleep(5); /* sleep 5 seconds */

Regards,


Ed
 
Hi,
For Microsoft it would be

Sleep(5000);

with a capital S. and note that the value is in Milliseconds so you must multiple your seconds by 1000.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top