Rhino C++ API  7.21
Public Types | Public Member Functions | List of all members
ON_StopWatch Class Reference

#include <opennurbs_cpp_base.h>

Public Types

enum  State : unsigned char { State::Off = 0, State::Running = 1, State::Stopped = 2 }

Public Member Functions

 ON_StopWatch ()=default
 ON_StopWatch (const ON_StopWatch &)=default
 ~ON_StopWatch ()=default
ON_StopWatch::State CurrentState () const
double ElapsedTime () const
ON_StopWatchoperator= (const ON_StopWatch &)=default
void Reset ()
void Start ()
double Stop ()

Member Enumeration Documentation

◆ State

enum ON_StopWatch::State : unsigned char

summary> The stopwatch is off. /summary> summary> The stopwatch is started and running. /summary>


summary> The stopwatch has been started and stopped. /summary>


Constructor & Destructor Documentation

◆ ON_StopWatch() [1/2]

ON_StopWatch::ON_StopWatch ( )

◆ ~ON_StopWatch()

ON_StopWatch::~ON_StopWatch ( )

◆ ON_StopWatch() [2/2]

ON_StopWatch::ON_StopWatch ( const ON_StopWatch )

Member Function Documentation

◆ CurrentState()

ON_StopWatch::State ON_StopWatch::CurrentState ( ) const

Returns: Current state of the stopwatch.

◆ ElapsedTime()

double ON_StopWatch::ElapsedTime ( ) const

Returns: The elapsed time in seconds. Remarks: If the stopwatch is running, the elapsed time is the duration from the most recent Start() to now. If the stopwatch is stopped, the elapsed time is the duration between the most recent Start() and Stop(). If the stopwatch is off, the elapsed time is zero.

◆ operator=()

ON_StopWatch& ON_StopWatch::operator= ( const ON_StopWatch )

◆ Reset()

void ON_StopWatch::Reset ( )

Description: The stopwatch is reset and turned off. Any previously set times are lost.

◆ Start()

void ON_StopWatch::Start ( )

Description: If the stopwatch is off or stopped, it is started. Otherwise nothing happens.

◆ Stop()

double ON_StopWatch::Stop ( )

Description: If the stopwatch is running, then it is stopped. Otherwise nothing happens. Returns: If the stopwatch was running, the elapsed time from the most recent Start(). Otherwise, 0.0 is returned.