libpropeller
Making PropellerGCC Easier
 All Classes Files Functions Variables Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
Stopwatch Class Reference

Utility class for timing event duration. More...

#include <stopwatch.h>

Public Member Functions

 Stopwatch ()
 
void Reset (void)
 Stop timing. More...
 
void Start (void)
 Start timing. More...
 
int GetElapsed (void) const
 Get current stopwatch time (when started). More...
 
bool GetStarted (void) const
 Get started state. More...
 

Detailed Description

Utility class for timing event duration.

Warning
The maximum time that can be recorded is (2^32/CLKFREQ) seconds. At 80Mhz that is a bit over 53 seconds. Longer durations will rollover and make the stopwatch operate incorrectly.
Author
srlm (srlm@.nosp@m.srlm.nosp@m.produ.nosp@m.ctio.nosp@m.ns.co.nosp@m.m)

Constructor & Destructor Documentation

Stopwatch::Stopwatch ( )
inline

Here is the call graph for this function:

Member Function Documentation

int Stopwatch::GetElapsed ( void  ) const
inline

Get current stopwatch time (when started).

Returns
the number of elapsed milliseconds since start.
bool Stopwatch::GetStarted ( void  ) const
inline

Get started state.

Returns
true if started, false otherwise.
void Stopwatch::Reset ( void  )
inline

Stop timing.

void Stopwatch::Start ( void  )
inline

Start timing.

Can be called without calling reset first.


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