0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-30 15:58:20 +02:00

modules/console: Minor simplify cmd.

This commit is contained in:
Jason Volk 2019-08-20 20:28:50 -07:00
parent 2638a316b6
commit a5e422cc03

View file

@ -781,30 +781,8 @@ console_cmd__uptime(opt &out, const string_view &line)
ircd::uptime()
};
const hours uptime_h
{
uptime.count() / (60L * 60L)
};
const minutes uptime_m
{
(uptime.count() / 60L) % 60L
};
const minutes uptime_s
{
uptime.count() % 60L
};
out << "Running for ";
if(uptime_h.count())
out << uptime_h.count() << " hours ";
if(uptime_m.count())
out << uptime_m.count() << " minutes ";
out << uptime_s.count() << " seconds." << std::endl;
char tmp[48];
out << pretty(tmp, uptime) << std::endl;
return true;
}