| 42 | } |
| 43 | |
| 44 | static struct timemono grains_to_time(uint64_t grains) |
| 45 | { |
| 46 | struct timemono t; |
| 47 | |
| 48 | t.ts.tv_sec = grains / (1000000000 / TIMER_GRANULARITY); |
| 49 | t.ts.tv_nsec = (grains % (1000000000 / TIMER_GRANULARITY)) |
| 50 | * TIMER_GRANULARITY; |
| 51 | return t; |
| 52 | } |
| 53 | |
| 54 | void timers_init(struct timers *timers, struct timemono start) |
| 55 | { |