mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 16:22:35 +01:00
modules/console: Add time cmd to time cmds.
This commit is contained in:
parent
c3988c6859
commit
ceb9559a56
1 changed files with 22 additions and 0 deletions
|
@ -309,6 +309,28 @@ console_cmd__test(opt &out, const string_view &line)
|
|||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// Time cmd prefix (like /usr/bin/time)
|
||||
//
|
||||
|
||||
bool
|
||||
console_cmd__time(opt &out, const string_view &line)
|
||||
{
|
||||
ircd::timer timer;
|
||||
|
||||
const auto ret
|
||||
{
|
||||
_console_command(out, line)
|
||||
};
|
||||
|
||||
thread_local char buf[32];
|
||||
out << std::endl
|
||||
<< pretty(buf, timer.at<microseconds>())
|
||||
<< std::endl;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
//
|
||||
// Derived commands
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue