Jump to content
  • Advertisement
Sign in to follow this  
APC

Sleep() function?

This topic is 4498 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to use the Sleep() function in c++, but can't seem to find the correct header file. Anybody know what its called? Thanks ahead of time

Share this post


Link to post
Share on other sites
Advertisement
sleep() is in <unistd.h>, but might also be found in <cstdlib>, possibly renamed _sleep() on Win32 platforms.

Sleep() is likely to be in <windows.h>

Share this post


Link to post
Share on other sites
Has extra functionality been added to cstdlib over stdlib.h. I looked in K & R and there was no mention of the sleep function being in stdlib.h.

Dave

Share this post


Link to post
Share on other sites
i tried stdlib and unistd with the captial Sleep() but didn't try either with the lowercase sleep()

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Actually, Sleep is declared in the WinBase header, though you should include the Windows header.

Share this post


Link to post
Share on other sites
Quote:
Original post by Dave
I looked in K & R and there was no mention of the sleep function being in stdlib.h.


AFAIK, sleep() is POSIX, though not ISO. Its proper resting place is unistd.h, but Windows platform, although they claim some level of POSIX compliance, do not have that header.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!