Support Forum       G3D Web Page     
Public Member Functions | List of all members
G3D::ContinuousStopwatch Class Reference

Provides accurate measurement of sequences of durations. More...

Public Member Functions

 ContinuousStopwatch (const String &name="Stopwatch", bool enabled=false)
 
bool enabled () const
 
const RealTime getElapsedTime ()
 Get elapsed time since previous marker and start of sequence. More...
 
void printElapsedTime (const String &marker=String())
 Prints the elapsed time since previous marker and start of sequence. More...
 
void restart ()
 Restarts the stopwatch with a new starting time. More...
 
void setEnabled (bool enabled)
 Set whether printElapsedTime output is enabled. More...
 

Detailed Description

Provides accurate measurement of sequences of durations.

Example: For profiling sequences of code

    ContinousStopwatch sw("My Stopwatch", true);
    slowOperation();
    sw.printElapsedTime("slowOperation");
    kdTree.balance();
    sw.printElapsedTime("Balance tree");
See also
Stopwatch

Constructor & Destructor Documentation

◆ ContinuousStopwatch()

G3D::ContinuousStopwatch::ContinuousStopwatch ( const String name = "Stopwatch",
bool  enabled = false 
)

Member Function Documentation

◆ enabled()

bool G3D::ContinuousStopwatch::enabled ( ) const
inline

◆ getElapsedTime()

const RealTime G3D::ContinuousStopwatch::getElapsedTime ( )

Get elapsed time since previous marker and start of sequence.

◆ printElapsedTime()

void G3D::ContinuousStopwatch::printElapsedTime ( const String marker = String())

Prints the elapsed time since previous marker and start of sequence.

Referenced by G3D::Stopwatch::printElapsedTime().

◆ restart()

void G3D::ContinuousStopwatch::restart ( )

Restarts the stopwatch with a new starting time.

Referenced by G3D::Stopwatch::reset().

◆ setEnabled()

void G3D::ContinuousStopwatch::setEnabled ( bool  enabled)
inline

Set whether printElapsedTime output is enabled.

Referenced by G3D::Stopwatch::setEnabled().


documentation generated on Wed Nov 24 2021 08:01:54 using doxygen 1.8.15