Public Member Functions

jsplib::CScopedTiming Class Reference

A simple class to do scoped timing. More...

#include <CScopedTiming.hh>

List of all members.

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.

Detailed Description

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;

Constructor & Destructor Documentation

jsplib::CScopedTiming::CScopedTiming ( double &  out  )  [inline]

Creates a scoped timing object.

The timer is started on construction

Parameters:
out The variable to which to add the elapsed time upon destruction of this object

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator