How do you make a program sleep in C++ on Win 32?

Chris_45 picture Chris_45 · Feb 12, 2010 · Viewed 85.6k times · Source

How does one "pause" a program in C++ on Win 32, and what libraries must be included?

Answer

IVlad picture IVlad · Feb 12, 2010
#include <windows.h>

Sleep(number of milliseconds);

Or if you want to pause your program while waiting for another program, use WaitForSingleObject.