Subversion Repositories Kolibri OS

Rev

Rev 3247 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3247 Rev 8827
Line 1... Line 1...
1
int cmd_uptime(char param[])
1
void get_str_uptime(char *str, const char *fmt) {
2
{
-
 
3
unsigned	time_tick, up_days, up_hours, up_minutes, up_seconds, up_millisecs;
2
	unsigned	time_tick, up_days, up_hours, up_minutes, up_seconds, up_millisecs;
Line 4... Line 3...
4
 
3
 
5
time_tick = kol_time_tick();
4
	time_tick = kol_time_tick();
6
up_days = (time_tick/(24*60*60*100));
5
	up_days = (time_tick/(24*60*60*100));
7
up_hours = (time_tick/(60*60*100))%24;
6
	up_hours = (time_tick/(60*60*100))%24;
8
up_minutes = (time_tick/(60*100))%60;
7
	up_minutes = (time_tick/(60*100))%60;
9
up_seconds = (time_tick/100)%60;
8
	up_seconds = (time_tick/100)%60;
Line 10... Line -...
10
up_millisecs = (time_tick*10)%100;
-
 
11
 
9
	up_millisecs = (time_tick*10)%100;
-
 
10
 
-
 
11
	sprintf (str, fmt, up_days, up_hours, up_minutes, up_seconds, up_millisecs);
12
#if LANG_ENG
12
}
13
	printf ("  Uptime: %d day(s), %d:%d:%d.%d\n\r", up_days, up_hours, up_minutes, up_seconds, up_millisecs);
13
 
14
#elif LANG_RUS
14
int cmd_uptime(char param[]) {
15
	printf ("  Uptime: %d ¤­¥©, %d:%d:%d.%d\n\r", up_days, up_hours, up_minutes, up_seconds, up_millisecs);
15
	get_str_uptime(tmpstr, CMD_UPTIME_FMT);
16
#endif
16
	printf(tmpstr);