21 lines
320 B
C
Raw Normal View History

2011-06-19 15:41:06 +03:00
#if defined(_WIN32)
2016-07-09 11:21:54 +02:00
#include <windows.h>
2011-06-19 15:41:06 +03:00
#else
2016-07-09 11:21:54 +02:00
#include <unistd.h>
2011-06-19 15:41:06 +03:00
#endif
/* sleeps for n seconds, where n is the argument to the program */
int main(int argc, char** argv)
{
int time;
2016-07-09 11:21:54 +02:00
if (argc > 1) {
2011-06-19 15:41:06 +03:00
time = atoi(argv[1]);
2016-07-09 11:21:54 +02:00
}
2011-06-19 15:41:06 +03:00
#if defined(_WIN32)
Sleep(time * 1000);
#else
sleep(time);
#endif
return 0;
}