1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-05-02 13:43:52 +00:00

Changed to steady clock for timer

This commit is contained in:
Henry Fredrick Schreiner 2017-05-16 08:16:21 -04:00
parent 29e0b5c0f0
commit 32b2e158a5

View File

@ -13,7 +13,7 @@ namespace CLI {
class Timer {
protected:
/// This is a typedef to make clocks easier to use
typedef std::chrono::high_resolution_clock clock;
typedef std::chrono::steady_clock clock;
/// This typedef is for points in time
typedef std::chrono::time_point<clock> time_point;
@ -69,8 +69,8 @@ public:
start_ = start;
return out;
}
/// This formats the numerical value for the time string
/// This formats the numerical value for the time string
std::string make_time_str() const {
time_point stop = clock::now();
std::chrono::duration<double> elapsed = stop - start_;
@ -102,7 +102,7 @@ public:
return time_print_(title_, make_time_str());
}
/// Division sets the number of cycles
/// Division sets the number of cycles to divide by (no graphical change)
Timer& operator / (size_t val) {cycles = val; return *this;}
};