0
0
Fork 0
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:
Jason Volk 2018-10-18 14:04:46 -07:00
parent c3988c6859
commit ceb9559a56

View file

@ -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
//