47 time.tv_sec = nanoTime / kNanosPerSecond;
48 time.tv_nsec = nanoTime - (time.tv_sec * kNanosPerSecond);
49 return 0 - clock_nanosleep(clockId, TIMER_ABSTIME, &time, NULL);
61 static int sleepForNanos(int64_t nanoseconds, clockid_t clockId = CLOCK_REALTIME) {
62 if (nanoseconds > 0) {
64 time.tv_sec = nanoseconds / kNanosPerSecond;
65 time.tv_nsec = nanoseconds - (time.tv_sec * kNanosPerSecond);
66 return 0 - clock_nanosleep(clockId, 0, &time, NULL);