This class can be used to test how much time is used when executing a part of the code.
More...
#include <CodeTimer.hpp>
|
| | CodeTimer (std::string name="CodeTimer") |
| | Register a new code time ounde the name name. if name already exists then add the time from this execution to the a label and increment the amount of times this label has been called. More...
|
| |
|
virtual | ~CodeTimer () |
| | calls stop();
|
| |
| void | operator() (std::string newName) |
| | Stops the time and starts it under a new label. More...
|
| |
|
void | stop () |
| | stop the code timer. if Print outs enabled print the time, else store the result in the static repport.
|
| |
| void | stopAndStartWithName (std::string name) |
| | Stop the Current Time, and restart it with a new name. More...
|
| |
|
|
static void | getRepport () |
| | Get the Repport object.
|
| |
| static void | enablePrintOuts (bool enable) |
| | enable or disable printouts when stop is called on a global level More...
|
| |
This class can be used to test how much time is used when executing a part of the code.
◆ CodeTimer()
Register a new code time ounde the name name. if name already exists then add the time from this execution to the a label and increment the amount of times this label has been called.
OBS this code is not multthread friendly, so only create instances of this class in a single thread
- Parameters
-
| name | name of the code label |
◆ enablePrintOuts()
| static void enablePrintOuts |
( |
bool |
enable | ) |
|
|
static |
enable or disable printouts when stop is called on a global level
- Parameters
-
◆ operator()()
| void operator() |
( |
std::string |
newName | ) |
|
Stops the time and starts it under a new label.
- Parameters
-
◆ stopAndStartWithName()
| void stopAndStartWithName |
( |
std::string |
name | ) |
|
Stop the Current Time, and restart it with a new name.
- Parameters
-
The documentation for this class was generated from the following file: