Xinqi Bao's Git
274b41b286bce9a8ccb13f6db0139bc274bbd1e7
1 /* See LICENSE file for copyright and license details. */
11 struct timespec uptime
;
12 if (clock_gettime(CLOCK_BOOTTIME
, &uptime
) < 0) {
13 warn("clock_gettime 'CLOCK_BOOTTIME'");
16 h
= uptime
.tv_sec
/ 3600;
17 m
= uptime
.tv_sec
% 3600 / 60;
18 return bprintf("%dh %dm", h
, m
);