RosettaCodeData/Task/Sleep/C++/sleep-2.cpp

15 lines
259 B
C++
Raw Permalink Normal View History

2013-04-11 01:07:29 -07:00
#include <unistd.h>
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
useconds_t microseconds;
cin >> microseconds;
cout << "Sleeping..." << endl;
usleep(microseconds);
cout << "Awake!" << endl;
return 0;
}