Xinqi Bao's Git
f957f17bcf4a5942f06e60d45f25b93de28c3cf8
1 /* See LICENSE file for copyright and license details. */
12 struct timespec uptime
;
14 if (clock_gettime(CLOCK_BOOTTIME
, &uptime
) < 0) {
15 warn("clock_gettime 'CLOCK_BOOTTIME'");
19 h
= uptime
.tv_sec
/ 3600;
20 m
= uptime
.tv_sec
% 3600 / 60;
22 return bprintf("%" PRIu64
"h %" PRIu64
"m", h
, m
);