#include "larcorealg/TestUtils/StopWatch.h"
#include <chrono>
#include <ratio>
#include <thread>
#include <iostream>
 
Go to the source code of this file.
 | 
| void  | wait (std::chrono::milliseconds dur) | 
|   | 
| int  | main (int, char **) | 
|   | 
      
        
          | int main  | 
          ( | 
          int  | 
          ,  | 
        
        
           | 
           | 
          char **  | 
            | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 32 of file StopWatch_test.cc.
   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. 
 
ElapsedTime_t elapsed() const 
Returns the total time spent running since the last restart. 
 
microsecond microseconds
Alias for common language habits. 
 
ElapsedTime_t partial() const 
Returns the time spent running since the last resume. 
 
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. 
 
void resume()
Resumes the run of the watch; previous time is preserved. 
 
QTextStream & endl(QTextStream &s)
 
 
 
 
      
        
          | void wait  | 
          ( | 
          std::chrono::milliseconds  | 
          dur | ) | 
           | 
        
      
 
Definition at line 26 of file StopWatch_test.cc.
   27   std::cout << 
" <waiting for " << dur.count() << 
" ms>" << 
std::endl;
    28   std::this_thread::sleep_for(dur);
 QTextStream & endl(QTextStream &s)