Parasol Planning Library (PPL)
ClockClass Class Reference

#include <ClockClass.h>

Public Member Functions

Construction
 ClockClass ()
 
Interface
void SetName (const std::string &_name)
 
void ClearClock ()
 Reset the clock. More...
 
void StartClock ()
 
void StopClock ()
 
void StopPrintClock (std::ostream &_os)
 Call StopClock and PrintClock. More...
 
void PrintClock (std::ostream &_os)
 
double GetSeconds () const
 Get the recorded time in seconds. More...
 
double GetUSeconds () const
 Get the recorded time in microseconds. More...
 

Detailed Description

This class is used to measure the processor time used between StartClock and StopClock calls. This includes both user and system time.

Note
Instances of this class are not thread-safe and should only be used by a single thread. It is safe to run separate instances in different threads.

Constructor & Destructor Documentation

◆ ClockClass()

ClockClass::ClockClass ( )

Member Function Documentation

◆ ClearClock()

void ClockClass::ClearClock ( )

Reset the clock.

◆ GetSeconds()

double ClockClass::GetSeconds ( ) const

Get the recorded time in seconds.

◆ GetUSeconds()

double ClockClass::GetUSeconds ( ) const

Get the recorded time in microseconds.

◆ PrintClock()

void ClockClass::PrintClock ( std::ostream &  _os)

Print clock name and time in seconds to an outstream.

Parameters
_osThe outstream to print to.

◆ SetName()

void ClockClass::SetName ( const std::string &  _name)

Set the clock name.

Parameters
_nameThe name to use.

◆ StartClock()

void ClockClass::StartClock ( )

Start the clock and the name is identity of this clock.

Exceptions
Ifthe clock is already started.

◆ StopClock()

void ClockClass::StopClock ( )

Stop the clock and calculate the total running time.

Exceptions
Ifthe clock is already stopped.

◆ StopPrintClock()

void ClockClass::StopPrintClock ( std::ostream &  _os)

Call StopClock and PrintClock.


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