The system_time() function used the wrong element of the splits array.
Also add a comment about the units for time measurements.
libstdc++-v3/ChangeLog:
* testsuite/util/testsuite_performance.h (time_counter): Add
comment about times.
(time_counter::system_time): Use correct split value.
class time_counter
{
private:
+ // All times are measured in clock ticks.
+ // There are CLOCKS_PER_SEC ticks per second.
+ // POSIX requires CLOCKS_PER_SEC == 1000000 so ticks == microseconds.
clock_t elapsed_begin;
clock_t elapsed_end;
tms tms_begin;
std::size_t
system_time() const
- { return (tms_end.tms_stime - tms_begin.tms_stime) + splits[1]; }
+ { return (tms_end.tms_stime - tms_begin.tms_stime) + splits[2]; }
};
class resource_counter