Return the time 'time_us' microseconds away from now in 'abs_time'.
| 60 | |
| 61 | /// Return the time 'time_us' microseconds away from now in 'abs_time'. |
| 62 | inline void TimeFromNowMicros(int64_t time_us, timespec* abs_time) { |
| 63 | clock_gettime(CLOCK_MONOTONIC, abs_time); |
| 64 | abs_time->tv_nsec += (time_us % MICROS_PER_SEC) * NANOS_PER_MICRO; |
| 65 | abs_time->tv_sec += time_us / MICROS_PER_SEC + abs_time->tv_nsec / NANOS_PER_SEC; |
| 66 | abs_time->tv_nsec %= NANOS_PER_SEC; |
| 67 | } |
| 68 | |
| 69 | /// Return the time 'time_ms' milliseconds away from now in 'abs_time'. |
| 70 | inline void TimeFromNowMillis(int64_t time_ms, timespec* abs_time) { |
no outgoing calls
no test coverage detected