bench: use std::chrono rather than gettimeofday
Summary:
- bench: switch to std::chrono for time measurements
std::chrono removes portability issues.
Rather than storing doubles, store the untouched time_points. Then
convert to nanoseconds for display. This allows for maximum precision, while
keeping results comparable between differing hardware/operating systems.
Also, display full nanosecond counts rather than sub-second floats.
- bench: prefer a steady clock if the resolution is no worse
- Require a steady clock for bench with at least micro precision
This is a backport of core PR11562 and PR11646
Test Plan:
make ./src/bench/bench_bitcoin
Reviewers: #bitcoin_abc, jasonbcox
Reviewed By: #bitcoin_abc, jasonbcox
Subscribers: teamcity
Differential Revision: https://reviews.bitcoinabc.org/D1842