17 const double duration =
Stop();
19 std::cout << info <<
" costs " << std::fixed << std::setprecision(3) << duration
22 std::cout << info <<
" costs " << std::fixed << std::setprecision(3)
23 << duration / 1000.0 <<
"s" << std::endl;
25 std::cout << info <<
" costs " << std::fixed << std::setprecision(3)
26 << duration / 60000.0 <<
"m" << std::endl;
Elapsed wall-time and CPU-cycles declaration.
const double CLOCK_USE_MIN
Show clock time in minutes.
const double CLOCK_USE_SEC
Show clock time in seconds.
__inline__ double Stop() const
Stop the timer and return duration from start() in ms.
void StopInfo(const std::string &info, std::ostream &out=std::cout) const
Stop the timer and print out duration time.