Sleep For windows

I want it to wait 15 seconds im on windows.
sleep(15)
Sleep(15)
nether work?
The parameter is milliseconds:

Sleep(15000);
Just says sleep is undeclared.
Did you add #include <windows.h> ?
Ok works. This is my full code
while (pause == 1)
{
Sleep(1000);
date += 1;
cout << date + "\n";
}
but it has weird output it is pauseauseusesee
and i want it to say the date?
iF I REMOVE THE \N IT WORKs but it need a line break.
Last edited on
What type is date? I can't think of a type that would responed sensibly to having the number 1 added to it, AND having "\n" added to it.
closed account (o3hC5Di1)
Hi there,

What you mean to use is this:

cout << date << "\n";

All the best,
NwN
works like a charm :)
Topic archived. No new replies allowed.