Stopwatch Class Reference
#include <Stopwatch.h>
![](../class_stopwatch.png)
# Public Member Functions | |
void | constructor () |
Class' constructor. | |
void | destructor () |
Class' destructor. | |
void | reset () |
Reset the state of the stopwatch. | |
void | update () |
Update the state of the stopwatch. | |
float | lap () |
# Protected Attributes | |
uint32 | milliSeconds |
Elapsed time in milliseconds. | |
uint32 | interrupts |
Interrupts counter. | |
uint32 | timerCounter |
Timer counter's configuration value. | |
uint32 | previousTimerCounter |
Last registered timer counter's configuration value. | |
float | timeProportion |
Ratio between elapsed time per interrupt and timer counter's value. |
# Additional Inherited Members | |
![]() | |
void | constructor () |
Class' constructor. | |
void | destructor () |
Class' destructor. | |
void | addEventListener (ListenerObject listener, uint16 eventCode) |
void | removeEventListener (ListenerObject listener, uint16 eventCode) |
void | removeEventListeners (uint16 eventCode) |
void | removeAllEventListeners () |
Remove all listener objects. | |
bool | hasActiveEventListeners () |
void | fireEvent (uint16 eventCode) |
void | sendMessageTo (ListenerObject receiver, uint32 message, uint32 delay, uint32 randomDelay) |
void | sendMessageToSelf (uint32 message, uint32 delay, uint32 randomDelay) |
void | discardAllMessages () |
Discard all messages, both to be sent and to be received. | |
void | discardMessages (uint32 message) |
virtual bool | onEvent (ListenerObject eventFirer, uint16 eventCode) |
virtual bool | handleMessage (Telegram telegram) |
![]() | |
VirtualList | events |
List of registered events. | |
int8 | eventFirings |
Counter that keeps track of the number of fired events to prevent race conditions in nested firings. |
# Detailed Description
Class Stopwatch
Inherits from ListenerObject
Implements a stopwatch to keep track of time passage.
Definition at line 28 of file Stopwatch.h.
# Member Function Documentation
# constructor()
void Stopwatch::constructor | ( | ) |
Class' constructor.
Definition at line 26 of file Stopwatch.c.
# destructor()
void Stopwatch::destructor | ( | ) |
Class' destructor.
Definition at line 39 of file Stopwatch.c.
# lap()
float Stopwatch::lap | ( | ) |
Register a new lap.
- Returns
- Elapsed time during the last lap
Definition at line 68 of file Stopwatch.c.
# reset()
void Stopwatch::reset | ( | ) |
Reset the state of the stopwatch.
Definition at line 50 of file Stopwatch.c.
# update()
void Stopwatch::update | ( | ) |
Update the state of the stopwatch.
Definition at line 61 of file Stopwatch.c.
# Member Data Documentation
# interrupts
|
protected |
Interrupts counter.
Definition at line 36 of file Stopwatch.h.
# milliSeconds
|
protected |
Elapsed time in milliseconds.
Definition at line 33 of file Stopwatch.h.
# previousTimerCounter
|
protected |
Last registered timer counter's configuration value.
Definition at line 42 of file Stopwatch.h.
# timeProportion
|
protected |
Ratio between elapsed time per interrupt and timer counter's value.
Definition at line 45 of file Stopwatch.h.
# timerCounter
|
protected |
Timer counter's configuration value.
Definition at line 39 of file Stopwatch.h.
The documentation for this class was generated from the following files:
- VUEngine-Core/source/Misc/Time/Stopwatch.h
- VUEngine-Core/source/Misc/Time/Stopwatch.c