27 std::cout <<
" <waiting for " << dur.count() <<
" ms>" << std::endl;
28 std::this_thread::sleep_for(dur);
36 std::cout <<
"Creating stop watch..." << std::endl;
38 std::cout <<
" - elapsed time so far: " << timer.
elapsed() <<
" s; partial time: " << timer.
partial() <<
" s" << std::endl;
41 std::cout <<
" - elapsed time so far: " << timer.
elapsed() <<
" s (" << timer.
elapsed<std::micro>() <<
" us); partial time: " << timer.
partial<std::micro>() <<
" us" << std::endl;
43 std::cout <<
"Stopping watch" << std::endl;
48 std::cout <<
"Resuming watch" << std::endl;
53 std::cout <<
"Restarting watch" << std::endl;
void wait(std::chrono::milliseconds dur)
void stop()
Pauses the watch.
microsecond microseconds
Alias for common language habits.
void restart()
Restarts the watch; previous time is forgotten.
Provides time interval measurements.
second seconds
Alias for common language habits.
millisecond milliseconds
Alias for common language habits.
Class to take current wall clock time differences.
ElapsedTime_t partial() const
Returns the time spent running since the last resume.
void resume()
Resumes the run of the watch; previous time is preserved.
int main(int argc, char **argv)
ElapsedTime_t elapsed() const
Returns the total time spent running since the last restart.
BEGIN_PROLOG could also be cout