server: add a few stopwatches

For measuring performance.
This commit is contained in:
Dirk-Jan C. Binnema
2023-01-19 00:38:26 +02:00
parent 87187d15d6
commit 201fe45edc
2 changed files with 10 additions and 3 deletions

View File

@ -231,11 +231,11 @@ struct StopWatch {
{
const auto us{static_cast<double>(to_us(Clock::now() - start_))};
if (us > 2000000)
g_debug("%s: finished after %0.1f s", name_.c_str(), us / 1000000);
g_debug("sw: %s: finished after %0.1f s", name_.c_str(), us / 1000000);
else if (us > 2000)
g_debug("%s: finished after %0.1f ms", name_.c_str(), us / 1000);
g_debug("sw: %s: finished after %0.1f ms", name_.c_str(), us / 1000);
else
g_debug("%s: finished after %g us", name_.c_str(), us);
g_debug("sw: %s: finished after %g us", name_.c_str(), us);
}
private: