Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
CStopWatch Class Reference

#include <Stopwatch.h>

Inheritance diagram for CStopWatch:
CWinIdleTimer

Public Member Functions

 CStopWatch (bool useFrameTime=false)
 
 ~CStopWatch ()
 
bool IsRunning () const
 Retrieve the running state of the stopwatch. More...
 
void StartZero ()
 Record start time and change state to running. More...
 
void Start ()
 Record start time and change state to running, only if the stopwatch is stopped. More...
 
void Stop ()
 Record stop time and change state to not running. More...
 
void Reset ()
 Set the start time such that time elapsed is now zero. More...
 
float GetElapsedSeconds () const
 Retrieve time elapsed between the last call to Start(), StartZero() or Reset() and; if running, now; if stopped, the last call to Stop(). More...
 
float GetElapsedMilliseconds () const
 Retrieve time elapsed between the last call to Start(), StartZero() or Reset() and; if running, now; if stopped, the last call to Stop(). More...
 

Constructor & Destructor Documentation

◆ CStopWatch()

CStopWatch::CStopWatch ( bool  useFrameTime = false)
explicit

◆ ~CStopWatch()

CStopWatch::~CStopWatch ( )
default

Member Function Documentation

◆ GetElapsedMilliseconds()

float CStopWatch::GetElapsedMilliseconds ( ) const
inline

Retrieve time elapsed between the last call to Start(), StartZero() or Reset() and; if running, now; if stopped, the last call to Stop().

Returns
Elapsed time, in milliseconds, as a float.

◆ GetElapsedSeconds()

float CStopWatch::GetElapsedSeconds ( ) const
inline

Retrieve time elapsed between the last call to Start(), StartZero() or Reset() and; if running, now; if stopped, the last call to Stop().

Returns
Elapsed time, in seconds, as a float.

◆ IsRunning()

bool CStopWatch::IsRunning ( ) const
inline

Retrieve the running state of the stopwatch.

Returns
True if stopwatch has been started but not stopped.

◆ Reset()

void CStopWatch::Reset ( void  )
inline

Set the start time such that time elapsed is now zero.

◆ Start()

void CStopWatch::Start ( void  )
inline

Record start time and change state to running, only if the stopwatch is stopped.

◆ StartZero()

void CStopWatch::StartZero ( )
inline

Record start time and change state to running.

◆ Stop()

void CStopWatch::Stop ( void  )
inline

Record stop time and change state to not running.


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