google / google/benchmark

format user counter as timing information

Open
#831 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
10.4k
Forks
1.8k
Avg merge
2d 4h
Merged PRs (30d)
8

Description

Hi,

I would like to add some more timings to the output, so I added some user counters, and in the function to be benchmarked, I record some timing information for certain block of code.

The output looks like:

```
--------------------------------------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations cor eig reg
--------------------------------------------------------------------------------------------------------------------------
spectra/10/40/2/2/process_time/real_time 0.012 ms 0.012 ms 63176 1.56285m 7.6555m 994.525u
spectra/10/40/2/4/process_time/real_time 0.016 ms 0.017 ms 41991 1.55633m 0.0126054 1018.47u
spectra/10/40/2/6/process_time/real_time 0.022 ms 0.022 ms 32986 1.56102m 0.0183076 1019.17u
spectra/10/40/2/8/process_time/real_time 0.028 ms 0.028 ms 25630 1.5661m 0.0236718 1021.9u
spectra/10/40/2/10/process_time/real_time 0.034 ms 0.034 ms 20381 1.53995m 0.029994 997.325u
```

As it shows, the custom counter values are shown as counts, which are not intuitive. I think it would be good to introduce a flag to format the counter as timing, and output in the same format and unit as the Time and CPU section.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.