kolibrios-gitea/programs/system/shell/cmd/cmd_uptime.c
Rustem Gimadutdinov (rgimad) 68cf3e4293 SHELL 0.8.2
- big refactoring, now uses libc.obj
- added kfetch command

git-svn-id: svn://kolibrios.org@8827 a494cfbc-eb01-0410-851d-a64ba20cac60
2021-06-12 21:34:41 +00:00

21 lines
556 B
C

void get_str_uptime(char *str, const char *fmt) {
unsigned time_tick, up_days, up_hours, up_minutes, up_seconds, up_millisecs;
time_tick = kol_time_tick();
up_days = (time_tick/(24*60*60*100));
up_hours = (time_tick/(60*60*100))%24;
up_minutes = (time_tick/(60*100))%60;
up_seconds = (time_tick/100)%60;
up_millisecs = (time_tick*10)%100;
sprintf (str, fmt, up_days, up_hours, up_minutes, up_seconds, up_millisecs);
}
int cmd_uptime(char param[]) {
get_str_uptime(tmpstr, CMD_UPTIME_FMT);
printf(tmpstr);
return TRUE;
}