C++ API Reference

This class works similar to timerX MEL command. More...

#include <MTimer.h>

Public Member Functions

 MTimer ()
 Default class constructor.
 
 MTimer (const MTimer &)
 Copy Constructor. More...
 
 ~MTimer ()
 The class destructor.
 
void beginTimer ()
 The call to this function starts the timer.
 
void endTimer ()
 The call to this function ends the timer.
 
double elapsedTime ()
 This function returns the time elapsed between the calls to beginTimer and endTimer.
 
MTimeroperator= (const MTimer &rhs)
 Assignment operator. More...
 
bool operator== (const MTimer &rhs) const
 Equality operator. More...
 
bool operator!= (const MTimer &rhs) const
 InEquality operator. More...
 
void clear ()
 This function resets the member variables so that same MTimer object can be used to time other portions of the code.
 

Detailed Description

This class works similar to timerX MEL command.

MTimer class provides the functionality for calculating the time elapsed/consumed in executing a particular portion of the code. The portion of the code to be timed is embedded inbetween the calls to'beginTimer()' and 'endTimer()'. A call to 'elapsedTime()' gives the time spent in executing that portion of the code. The calculated time in seconds will be with 2 decimal accuracy.

Examples:
AbcBullet/AbcBullet.cpp, splatDeformer/splatDeformer.cpp, sseDeformer/sseDeformer.cpp, threadedBoundingBox/threadedBoundingBox.cpp, threadingLockTests/threadingLockTests.cpp, threadTestCmd/threadTestCmd.cpp, and threadTestWithLocksCmd/threadTestWithLocksCmd.cpp.

Constructor & Destructor Documentation

MTimer ( const MTimer src)

Copy Constructor.

Parameters
[in]srcthe instance to copy

Member Function Documentation

MTimer & operator= ( const MTimer rhs)

Assignment operator.

Parameters
[in]rhsThe timer to copy from.
bool operator== ( const MTimer rhs) const

Equality operator.

Checks whether the start time and end time are same.

Parameters
[in]rhsThe timer to compare with.
bool operator!= ( const MTimer rhs) const

InEquality operator.

Parameters
[in]rhsThe timer to compare with.

The documentation for this class was generated from the following files: