kolibrios/programs/system/shell/cmd/cmd_uptime.c
Nasarus 4b4d896f8a Shell 0.4.5: Multilanguage, russification, some new commands (see History.txt for details)
git-svn-id: svn://kolibrios.org@1668 a494cfbc-eb01-0410-851d-a64ba20cac60
2010-10-20 23:58:36 +00:00

19 lines
602 B
C

int cmd_uptime(char param[])
{
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;
#if LANG_ENG
printf (" Uptime: %d day(s), %d:%d:%d.%d\n\r", up_days, up_hours, up_minutes, up_seconds, up_millisecs);
#elif LANG_RUS
printf (" Uptime: %d ¤­¥©, %d:%d:%d.%d\n\r", up_days, up_hours, up_minutes, up_seconds, up_millisecs);
#endif
return TRUE;
}