views:

536

answers:

4

The title says it all. I want to call Sleep(x), where x is milliseconds to sleep. I know this is the function, but it doesn't work for me. What do I need to include?

---SOLVED---

I was using the compiler option /Za, which disabled the native Windows extensions used in Sleep()'s implementation.

+1  A: 

you just Sleep(asManyMilliSecondsAsYouWant);

Serge - appTranslator
+2  A: 

Sleep Using WINAPI Sleep(__in DWORD dwAtleastFor8HoursForGoodHealth);

Include Winbase.h or Windows.h

aJ
+1  A: 

Sleep(int milliseconds) is a Win32 API to suspend execution of your program for the set number of milliseconds.

Include <windows.h> to get access to it.

MSDN usually lists what header files and libraries API's are in.

Michael
+2  A: 

Sleep is defined in Winbase.h, but you should include Windows.h to get it.

In the future you can find your information for yourself by bringing up the Help from VisualStudio or searching MSDN. All such info on Win32 API calls should be in there.

T.E.D.