mirror of https://github.com/mkerrisk/man-pages
clock_getres.2: Minor tweaks to example
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
a04e44bd3a
commit
bef940caef
|
@ -406,14 +406,14 @@ This is an example of what we might see when running the program:
|
||||||
.in +4n
|
.in +4n
|
||||||
.EX
|
.EX
|
||||||
$ \fB./clock_times x\fP
|
$ \fB./clock_times x\fP
|
||||||
CLOCK_REALTIME : 1585985459.446 (18356 days + 7h 30m 59s)
|
CLOCK_REALTIME : 1585985459.446 (18356 days + 7h 30m 59s)
|
||||||
resolution: 0.000000001
|
resolution: 0.000000001
|
||||||
CLOCK_TAI : 1585985496.447 (18356 days + 7h 31m 36s)
|
CLOCK_TAI : 1585985496.447 (18356 days + 7h 31m 36s)
|
||||||
resolution: 0.000000001
|
resolution: 0.000000001
|
||||||
CLOCK_MONOTONIC : 52395.722 (14h 33m 15s)
|
CLOCK_MONOTONIC: 52395.722 (14h 33m 15s)
|
||||||
resolution: 0.000000001
|
resolution: 0.000000001
|
||||||
CLOCK_BOOTTIME : 72691.019 (20h 11m 31s)
|
CLOCK_BOOTTIME : 72691.019 (20h 11m 31s)
|
||||||
resolution: 0.000000001
|
resolution: 0.000000001
|
||||||
.EE
|
.EE
|
||||||
.in
|
.in
|
||||||
.SS Program source
|
.SS Program source
|
||||||
|
@ -442,7 +442,7 @@ displayClock(clockid_t clock, char *name, bool showRes)
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("%\-22s: %10ld.%03ld (", name,
|
printf("%\-15s: %10ld.%03ld (", name,
|
||||||
(long) ts.tv_sec, ts.tv_nsec / 1000000);
|
(long) ts.tv_sec, ts.tv_nsec / 1000000);
|
||||||
|
|
||||||
long days = ts.tv_sec / SECS_IN_DAY;
|
long days = ts.tv_sec / SECS_IN_DAY;
|
||||||
|
@ -459,7 +459,7 @@ displayClock(clockid_t clock, char *name, bool showRes)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (showRes)
|
if (showRes)
|
||||||
printf(" resolution: %10ld.%09ld\en",
|
printf(" resolution: %10ld.%09ld\en",
|
||||||
(long) ts.tv_sec, ts.tv_nsec);
|
(long) ts.tv_sec, ts.tv_nsec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue