… | |
… | |
1906 | struct timespec ts; |
1906 | struct timespec ts; |
1907 | |
1907 | |
1908 | EV_TS_SET (ts, delay); |
1908 | EV_TS_SET (ts, delay); |
1909 | nanosleep (&ts, 0); |
1909 | nanosleep (&ts, 0); |
1910 | #elif defined _WIN32 |
1910 | #elif defined _WIN32 |
|
|
1911 | /* maybe this should round up, as ms is very low resolution */ |
|
|
1912 | /* compared to select (µs) or nanosleep (ns) */ |
1911 | Sleep ((unsigned long)(delay * 1e3)); |
1913 | Sleep ((unsigned long)(delay * 1e3)); |
1912 | #else |
1914 | #else |
1913 | struct timeval tv; |
1915 | struct timeval tv; |
1914 | |
1916 | |
1915 | /* here we rely on sys/time.h + sys/types.h + unistd.h providing select */ |
1917 | /* here we rely on sys/time.h + sys/types.h + unistd.h providing select */ |