Clarify whether CPU or wallclock time is used
alexeyr opened this issue · 2 comments
If the benchmarked code itself uses threads and you want to compare it to single-threaded code, you may want to use real-time ("wallclock") measurements for latency comparisons... Without
UseRealTime, CPU time is used by default.
and
By default, the CPU timer only measures the time spent by the main thread. If the benchmark itself uses threads internally, this measurement may not be what you are looking for. Instead, there is a way to measure the total CPU usage of the process, by all the threads.
Does nanobench use wallclock or CPU time? And if CPU, for all threads or main thread only? I'd assume wallclock, but not certain. You may also want to make it configurable.
Looks to be using steady_clock, which is CPU time.
system_clock is not used, so wall clock is not shown.
Actually steady_clock like all std::chrono clocks measure real time, so it includes time just waiting for e.g. IO. I've updated the documentation a bit.