google / google/benchmark

No max runtime when using UseManualTime?

Open
#1,158 1 comment 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

I was trying to measure something that needs somewhat expensive setup per iteration - compared to the thing that needs comparing. (It's not possible to perform this setup outside the benchmark loop.)

In both cases of either using `UseManualTime` the benchmark would take a long time to run, because it computes the max-time based on the measured time.

https://github.com/google/benchmark/blob/db2de74cc8c34131a6f673e35751935cc1897a0d/src/benchmark_runner.cc#L313-L314

I'm not finding any way to manually check and end the benchmark after a given amount of time.

Is there a way around this?

Also, what's the rationale to except manual timings from this sanity check? Would it be possible to consider this an opt-in/out option?

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.