mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-01 08:44:02 +02:00
log, timer: add timing macro in usec LOG_TIME_MICROS_WITH_CATEGORY
and update BCLog::LogMsg() to omit irrelevant decimals for microseconds and skip unneeded code and math.
This commit is contained in:
@@ -27,7 +27,7 @@ BOOST_AUTO_TEST_CASE(logging_timer)
|
||||
SetMockTime(1);
|
||||
auto micro_timer = BCLog::Timer<std::chrono::microseconds>("tests", "end_msg");
|
||||
SetMockTime(2);
|
||||
BOOST_CHECK_EQUAL(micro_timer.LogMsg("test micros"), "tests: test micros (1000000.00μs)");
|
||||
BOOST_CHECK_EQUAL(micro_timer.LogMsg("test micros"), "tests: test micros (1000000μs)");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
Reference in New Issue
Block a user