|
ʻOhana
Population structure, admixture history, and selection using learning methods.
|
7 #ifndef JADE_STOPWATCH_HPP__
8 #define JADE_STOPWATCH_HPP__
10 #include "jade.system.hpp"
17 template <
typename TClock>
46 const auto rhs = seconds;
47 return lhs < rhs ? -1 : rhs < lhs ? +1 : 0;
55 const auto t1 = clock_type::now();
56 const auto dt = std::chrono::duration<double>(t1 - _t0);
63 std::string
str()
const
65 std::ostringstream out;
66 out << std::fixed << std::setprecision(6) <<
get_elapsed();
101 typedef basic_stopwatch<std::chrono::high_resolution_clock> stopwatch;
109 template <
typename TClock>
110 std::ostream & operator << (
114 return dst << src.
str();
117 #endif // JADE_STOPWATCH_HPP__
bool operator>(const double rhs) const
Compares the elapsed time with the specified number of seconds. The operator returns a negative value...
bool operator<(const double rhs) const
Compares the elapsed time with the specified number of seconds. The operator returns a negative value...
double get_elapsed() const
TClock clock_type
The clock type.
A template class imlementing a stopwatch.
basic_stopwatch()
Initializes a new instance of the class.
int compare(const double seconds) const
Compares the elapsed time with the specified number of seconds. The method returns a negative value i...
clock_type::time_point time_point_type
The time point type for the clock.