Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error when period of steady_clock is not nano #1794

Merged
merged 1 commit into from
Nov 3, 2019
Merged

Fix error when period of steady_clock is not nano #1794

merged 1 commit into from
Nov 3, 2019

Conversation

cericks0n
Copy link
Contributor

Description

On systems where std::chrono::steady_clock::period is not std::nano, benchmark tests fail to compile due to trying to convert analysis.samples from a vector of duration<double, clock::period> to a vector of std::chrono::duration<double, std::nano>.

To fix this, we instead construct a BenchmarkStats that matches the period of the clock. Once it's constructed, BenchmarkStats's conversion operator will handle converting to other durations.

On systems where std::chrono::steady_clock::period is not std::nano, benchmark tests fail to compile due to trying to convert analysis.samples from a vector of duration<double, clock::period> to a vector of std::chrono::duration<double, std::nano>.
@codecov
Copy link

codecov bot commented Nov 1, 2019

Codecov Report

Merging #1794 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1794   +/-   ##
=======================================
  Coverage   86.19%   86.19%           
=======================================
  Files         131      131           
  Lines        3875     3875           
=======================================
  Hits         3340     3340           
  Misses        535      535

@horenmar
Copy link
Member

horenmar commented Nov 2, 2019

Thanks. Out of curiosity, what platform did you run into this on?

@cericks0n
Copy link
Contributor Author

I hit this on PS4.

@horenmar horenmar added the BugFix label Nov 3, 2019
@horenmar horenmar merged commit 59d2d08 into catchorg:master Nov 3, 2019
@cericks0n cericks0n deleted the patch-1 branch November 5, 2019 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants