A simple class to do scoped timing. More...
#include <CScopedTiming.hh>
Public Member Functions | |
CScopedTiming (double &out) | |
Creates a scoped timing object. | |
~CScopedTiming () | |
The destructor - the timer is stopped and the time elapsed is stored in the parameter specified in the constructor. |
A simple class to do scoped timing.
Upon creation the timer will start, on destruction the double specified in the constructor will be updated with the time in seconds that the object existed. If compiled under win32 then this is only accurate to 10ms or 16ms, under linux accuracy is dependant on the HZ kernel parameter
double dur; { jsplib::CScopedTiming(dur); some_operations_to_time(); } std::cout << "some_operations_to_time() took " << dur << " seconds to complete." << std::endl;
jsplib::CScopedTiming::CScopedTiming | ( | double & | out | ) | [inline] |
Creates a scoped timing object.
The timer is started on construction
out | The variable to which to add the elapsed time upon destruction of this object |