|
Biorbd Release_1.13.0
|
Collection of method to supercifically benchmark the code. More...
#include <Benchmark.h>
Public Member Functions | |
| Benchmark () | |
| Construct a benchmark analysis. | |
| void | startTimer (const String &name, bool force=false) |
| Start the timer of a specified name. | |
| void | pauseTimer (const String &name) |
| Pause a timer of a specified name. | |
| void | resumeTimer (const String &name) |
| Resume a timer of a specified name. | |
| double | getLap (const String &name) |
| Get lap time of a specified timer. | |
| double | stopTimer (const String &name) |
| Stop the timer of a specified name and get lap time. | |
| void | addTimer (const String &name) |
| Add a new timer to the timer set. | |
| int | getTimerIdx (const String &name) |
| Get the index of the specified timer. | |
Static Public Member Functions | |
| static void | wasteTime (double timeInSec) |
| To waste time (similar to a sleep function). | |
Protected Attributes | |
| std::map< String, Timer > | m_timers |
| Timers. | |
| std::map< String, int > | m_counts |
| Counts. | |
Collection of method to supercifically benchmark the code.
Benchmark can run multiple timers at the same time. One must simply gives different names
Definition at line 20 of file Benchmark.h.
| utils::Benchmark::Benchmark | ( | ) |
Construct a benchmark analysis.
Definition at line 9 of file Benchmark.cpp.
| void utils::Benchmark::addTimer | ( | const String & | name | ) |
Add a new timer to the timer set.
| name | The name of the timer to add |
Definition at line 37 of file Benchmark.cpp.
| double utils::Benchmark::getLap | ( | const String & | name | ) |
Get lap time of a specified timer.
| name | Name of the timer |
Definition at line 21 of file Benchmark.cpp.
| int utils::Benchmark::getTimerIdx | ( | const String & | name | ) |
Get the index of the specified timer.
| name | The name of the timer |
Definition at line 41 of file Benchmark.cpp.
| void utils::Benchmark::pauseTimer | ( | const String & | name | ) |
Pause a timer of a specified name.
| name | Name of the timer to pause |
Definition at line 29 of file Benchmark.cpp.
| void utils::Benchmark::resumeTimer | ( | const String & | name | ) |
Resume a timer of a specified name.
| name | Name of the timer to resume |
Definition at line 33 of file Benchmark.cpp.
| void utils::Benchmark::startTimer | ( | const String & | name, |
| bool | force = false ) |
Start the timer of a specified name.
| name | The name to associate with timer |
| force | If force is true, the timer starts even though it is already started |
Definition at line 13 of file Benchmark.cpp.
| double utils::Benchmark::stopTimer | ( | const String & | name | ) |
Stop the timer of a specified name and get lap time.
| name | Name of the timer |
Definition at line 25 of file Benchmark.cpp.
|
static |
To waste time (similar to a sleep function).
| timeInSec | Time in seconds to wait |
Definition at line 45 of file Benchmark.cpp.
|
protected |
Counts.
Definition at line 82 of file Benchmark.h.
Timers.
Definition at line 81 of file Benchmark.h.