diff options
author | Thomas Voss <mail@thomasvoss.com> | 2025-09-16 22:05:22 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2025-09-16 22:05:22 +0200 |
commit | 7bee53b298185c29dc82badadd07d01995e63584 (patch) | |
tree | 03f2004fca17b55e04a2d45921b1beb60e5e7421 /main.c | |
parent | 84f0e9ca1d395b6ff26f34dade8687e587de78d7 (diff) |
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 13 |
1 files changed, 1 insertions, 12 deletions
@@ -130,22 +130,11 @@ main(int argc, char **argv) if (clock_gettime(CLOCK_REALTIME, &then) == -1) warn(_("failed to get the time")); - /* Duration of the clock formatting and printing */ - struct timespec Δ = { - then.tv_sec - now.tv_sec, - then.tv_nsec - now.tv_nsec, - }; - if (Δ.tv_nsec < 0) { - Δ.tv_nsec += NSEC_PER_SEC; - Δ.tv_sec--; - } - + int rv; struct timespec rqtp = { .tv_sec = sync(then.tv_sec), .tv_nsec = 0, }; - - int rv; do rv = clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, &rqtp, nullptr); while (rv == -1 && errno == EINTR); |