23 #include <sys/types.h> 24 #include <sys/timeb.h> 32 namespace hidden_win32 {
39 time->
tv_sec = time_t(tod.time);
40 time->
tv_nsec = tod.millitm*1000000;
48 DWORD sleeptime_ms = DWORD(1000*rqtp->
tv_sec + rqtp->
tv_nsec/1000000);
74 unsigned int sleep(
unsigned int seconds)
78 ::Sleep(DWORD(1000*seconds));
81 if (sleep_time.
tsSec() >= seconds)
87 return static_cast<unsigned int>(sleep_time.
tsSec() - seconds);
95 ::Sleep(DWORD(useconds/1000));
99 if (sleep_time.
toUSec() + 1000 >= useconds)
Represents absolute times.
unsigned int sleep(unsigned int seconds)
Win32 implementation of the global functions for time manipulation,.
int usleep(unsigned long useconds)
int nanosleep(const struct timespec *rqtp, struct timespec *rmtp)
Repesents absolute times.
void gettimeofday(struct timespec *time)
int64_t toUSec() const
May result in an overflow if seconds are too large.