inline int usleep(useconds_t microseconds) { struct timespec ts; ts.tv_sec = microseconds / (useconds_t)1000000; ts.tv_nsec = (long)(microseconds % (useconds_t)1000000) * 1000L; return nanosleep(&ts, NULL); }