MAIA bb96820c
Multiphysics at AIA
|
MTimers manages all MAIA Timers and allows primitive profiling. More...
#include <timer.h>
Classes | |
struct | Timer |
Public Member Functions | |
MInt | newGroup (const std::string groupName) |
Creates a new timer group and returns its groupId. More... | |
MInt | newGroupTimer (const std::string timerName, const MInt groupId) |
Creates a new timer and returns its timerId. More... | |
MInt | newSubTimer (const std::string timerName, const MInt timerId) |
Creates a new timer and returns its timerId. More... | |
MFloat | returnTimer (const MInt timerId, const MString pos) |
Returns the timer Value. More... | |
MFloat | returnTimerTime (const MInt timerId) |
void | resetTimer (const MInt timerId, const MString pos) |
void | recordTimer (const MInt timerId, const MString pos) |
void | recordTimerStart (const MInt timerId, const MString pos) |
void | recordTimerStop (const MInt timerId, const MString pos) |
void | recordTimers (const MString pos) |
void | stopAllTimers (const MString pos) |
void | stopAllRecordTimers (const MString pos) |
void | displayTimer (const MInt timerId) |
void | displayTimerNoToggleDisplayed (const MInt timerId) |
void | displayAllTimers () |
void | displayAllTimers (const MInt groupId) |
void | resetTimers (const MString pos) |
void | resetRecord (const MInt timerId, const MFloat timerValue=0.0) |
void | resetRecords () |
MInt | isRunning (const MInt timerId) const |
Private Member Functions | |
void | startTimer (const MInt timerId, const MString pos) |
void | stopTimer (const MInt timerId, const MString pos) |
Stops the timer and sets its final value. More... | |
MTimers () | |
~MTimers () | |
MTimers (MTimers &) | |
MTimers & | operator= (const MTimers &) |
MFloat | time () |
Returns Wall-Clock time in seconds. More... | |
void | displayTimer_ (const MInt timerId, const MBool toggleDisplayed=true, const MInt tIndent=0, const MFloat superTime=-1.0) |
void | displayTimerHeader_ () |
void | displayTimerGroupHeader_ (const MInt groupId) |
MInt | indent (const MInt pIndent) const |
Private Attributes | |
std::vector< std::string > | m_groups |
std::vector< Timer > | m_timers |
Friends | |
MTimers & | timers () |
Usage:
Example:
RESET_TIMER; MInt myTimer; myTimer = NEW_TIMER("My timer");
START_TIMER(myTimer); f1(); // Function will be timed. STOP_TIMER(myTimer); f2(); // Function will not be timed. START_TIMER(myTimer); f3(); // Function will be timed. STOP_TIMER(myTimer);
DISPLAY_TIMER(myTimer);
NOTE: MAIA_TIMER_FUNCTION macro enable/disables timing MAIA.
|
inlineprivate |
|
private |
|
inline |
|
inline |
Definition at line 609 of file timer.h.
|
inline |
Definition at line 627 of file timer.h.
|
inlineprivate |
Definition at line 528 of file timer.h.
|
inlineprivate |
|
inline |
Definition at line 633 of file timer.h.
|
inline |
Definition at line 353 of file timer.h.
Definition at line 298 of file timer.h.
|
inline |
Definition at line 374 of file timer.h.
Definition at line 287 of file timer.h.
|
inline |
Definition at line 281 of file timer.h.
|
inline |
Definition at line 423 of file timer.h.
Definition at line 385 of file timer.h.
|
inline |
Definition at line 514 of file timer.h.
|
inline |
Definition at line 455 of file timer.h.
|
inlineprivate |
Timers are not portable. We should use the C++ <chrono> library instead. The factors convert the cpu time to seconds
Definition at line 258 of file timer.h.