class MTimer

Jump to documentation

This class works similar to timerX MEL command. (OpenMaya) (OpenMaya.py)

public members:

MTimer ()
MTimer ( const MTimer & )
~MTimer ()
void beginTimer ()
void endTimer ()
double elapsedTime ()
MTimer & operator = ( const MTimer & rhs )
bool operator == ( const MTimer & rhs ) const
bool operator != ( const MTimer & rhs ) const
void clear ()

Documentation

Methods for calculating the time elapsed in executing a particular portion of the code.
Description

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.

Functions

MTimer:: MTimer ()
Description

Default class constructor.

MTimer:: MTimer (const MTimer & src)

Description

Copy Constructor.

Arguments

  • src the instance to copy

MTimer:: ~MTimer ()

Description

The class destructor.

MTimer & MTimer:: operator= ( const MTimer & rhs )
Description

Assignment operator.

bool MTimer:: operator == ( const MTimer & rhs ) const
Description

Equality operator. Checks whether the start time and end time are same.

bool MTimer:: operator != ( const MTimer & rhs ) const
Description

InEquality operator.

void MTimer:: beginTimer ()
Description

The call to this function starts the timer.

void MTimer:: endTimer ()
Description

The call to this function ends the timer.

double MTimer:: elapsedTime ()
Description

This function returns the time elapsed between the calls to beginTimer and endTimer.

void MTimer:: clear ()
Description

This function resets the member variables so that same MTimer object can be used to time other portions of the code.

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright