|
wavelength 1.0.0
|
Stopwatch on the EE cycle counter. More...
#include <timer.h>
Public Member Functions | |
| Timer () | |
| Construct a stopped timer with no measurement. | |
| void | Reset () |
| Stop the timer and record the cycles measured so far in milliseconds in mLastMs. | |
| void | Pause () |
| Suspend a running timer, adding the cycles since the start to mCycles. | |
| void | Resume () |
| Continue a timer Pause() suspended from the current counter reading. | |
| void | Split () |
| Restart the measurement at the current counter reading. | |
| void | Start () |
| Raise the start count, and take the counter reading when the count leaves zero. | |
| void | Stop () |
| Lower the start count, and add the cycles since the start to mCycles when it arrives at zero. | |
| unsigned | GetCycles () const |
| void | SetCycles (unsigned nCycles) |
| float | GetLastMs () const |
| void | SetLastMs (float fLastMs) |
| const char * | GetName () const |
| void | SetName (const char *pszName) |
| void | SetRunning (int nRunning) |
| Timer () | |
Static Public Member Functions | |
| static Timer * | Find (const char *pszName) |
| Find a timer of the registry of named timers. | |
Public Attributes | |
| int | mReserved00 |
| int | mReserved04 |
| int | mReserved08 |
| int | mReserved10 |
Static Public Attributes | |
| static std::vector< Timer > | sTimers |
| The registry of named timers. | |
Stopwatch on the EE cycle counter.
A named timer of the timer configuration.
The RTTI includes the class name. The class is not polymorphic, and the object is 0x14 bytes with no vptr. The system clock at 0x00491a10 is one instance, and many routines build another on the stack to time their body.
Every member routine in the image is expanded inline at its call sites.
The RTTI records the class. The object is 0x14 bytes. Only the name is read by the control; the other members are placeholders that record the layout.
|
inline |
Construct a stopped timer with no measurement.
|
inline |
|
inline |
Stop the timer and record the cycles measured so far in milliseconds in mLastMs.
|
inline |
Suspend a running timer, adding the cycles since the start to mCycles.
The start count becomes negative until Resume().
|
inline |
Continue a timer Pause() suspended from the current counter reading.
|
inline |
Restart the measurement at the current counter reading.
Only a timer whose mRunning is exactly 1 is split. Any other timer is unchanged. A split timer stores the cycles since the previous reading in mCycles, replacing the earlier value.
|
inline |
Raise the start count, and take the counter reading when the count leaves zero.
|
inline |
Lower the start count, and add the cycles since the start to mCycles when it arrives at zero.
|
static |
Find a timer of the registry of named timers.
| pszName | The name. |
|
inline |
|
inline |
| nCycles | Cycles of the last completed measurement. |
|
inline |
|
inline |
| fLastMs | mCycles converted to milliseconds when the timer last stopped. |
|
inline |
|
inline |
| pszName | The name Find() matches, or null for an unnamed timer. |
|
inline |
| nRunning | Start count. The timer measures while the count is non-zero. |
|
static |
The registry of named timers.
| int Timer::mReserved00 |
| int Timer::mReserved04 |
| int Timer::mReserved08 |
| int Timer::mReserved10 |