2013-11-03 12:27:13 +02:00
|
|
|
#if defined(_WIN32)
|
2018-08-09 18:06:22 +02:00
|
|
|
# include <windows.h>
|
2022-11-16 20:14:03 +01:00
|
|
|
#elif _XOPEN_SOURCE >= 500 || defined(_ALL_SOURCE)
|
2018-08-09 18:06:22 +02:00
|
|
|
# include <unistd.h>
|
2022-11-16 20:14:03 +01:00
|
|
|
#else
|
|
|
|
# include <time.h>
|
|
|
|
|
|
|
|
# include <sys/select.h>
|
2013-11-03 12:27:13 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* sleeps for 0.1 second */
|
|
|
|
int main(int argc, char** argv)
|
|
|
|
{
|
|
|
|
#if defined(_WIN32)
|
|
|
|
Sleep(100);
|
2022-11-16 20:14:03 +01:00
|
|
|
#elif _XOPEN_SOURCE >= 500 || defined(_ALL_SOURCE)
|
2013-11-03 12:27:13 +02:00
|
|
|
usleep(100 * 1000);
|
2022-11-16 20:14:03 +01:00
|
|
|
#else
|
|
|
|
struct timeval tv;
|
|
|
|
tv.tv_sec = 0;
|
|
|
|
tv.tv_usec = 100 * 1000;
|
|
|
|
|
|
|
|
select(0, NULL, NULL, NULL, &tv);
|
2013-11-03 12:27:13 +02:00
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|