mirror of
https://github.com/matrix-construct/construct
synced 2024-10-01 05:08:59 +02:00
modules/console: Minor simplify cmd.
This commit is contained in:
parent
2638a316b6
commit
a5e422cc03
1 changed files with 2 additions and 24 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue