Sleep For windows

Jun 13, 2012 at 4:41am
I want it to wait 15 seconds im on windows.
sleep(15)
Sleep(15)
nether work?
Jun 13, 2012 at 4:48am
The parameter is milliseconds:

Sleep(15000);
Jun 13, 2012 at 4:50am
Just says sleep is undeclared.
Jun 13, 2012 at 5:00am
Did you add #include <windows.h> ?
Jun 13, 2012 at 5:07am
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?
Jun 13, 2012 at 3:21pm
iF I REMOVE THE \N IT WORKs but it need a line break.
Last edited on Jun 13, 2012 at 3:25pm
Jun 13, 2012 at 3:24pm
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.
Jun 13, 2012 at 3:31pm
closed account (o3hC5Di1)
Hi there,

What you mean to use is this:

cout << date << "\n";

All the best,
NwN
Jun 13, 2012 at 3:35pm
works like a charm :)
Topic archived. No new replies allowed.