Biorbd
Release_1.13.0
Toggle main menu visibility
Loading...
Searching...
No Matches
Benchmark.h
1
#ifndef BIORBD_UTILS_BENCHMARK_H
2
#define BIORBD_UTILS_BENCHMARK_H
3
4
#include "biorbdConfig.h"
5
6
#include <map>
7
#include <memory>
8
9
namespace
BIORBD_NAMESPACE {
10
namespace
utils {
11
class
String
;
12
class
Timer
;
13
20
class
BIORBD_API
Benchmark
{
21
public
:
25
Benchmark
();
26
33
void
startTimer
(
const
String
& name,
bool
force =
false
);
34
39
void
pauseTimer
(
const
String
& name);
40
45
void
resumeTimer
(
const
String
& name);
46
52
double
getLap
(
const
String
& name);
53
59
double
stopTimer
(
const
String
& name);
60
65
static
void
wasteTime
(
double
timeInSec);
66
71
void
addTimer
(
const
String
& name);
72
78
int
getTimerIdx
(
const
String
& name);
79
80
protected
:
81
std::map<String, Timer>
m_timers
;
82
std::map<String, int>
m_counts
;
83
};
84
85
}
// namespace utils
86
}
// namespace BIORBD_NAMESPACE
87
88
#endif
// BIORBD_UTILS_BENCHMARK_H
BIORBD_NAMESPACE::utils::Benchmark::resumeTimer
void resumeTimer(const String &name)
Resume a timer of a specified name.
Definition
Benchmark.cpp:33
BIORBD_NAMESPACE::utils::Benchmark::Benchmark
Benchmark()
Construct a benchmark analysis.
Definition
Benchmark.cpp:9
BIORBD_NAMESPACE::utils::Benchmark::wasteTime
static void wasteTime(double timeInSec)
To waste time (similar to a sleep function).
Definition
Benchmark.cpp:45
BIORBD_NAMESPACE::utils::Benchmark::m_timers
std::map< String, Timer > m_timers
Timers.
Definition
Benchmark.h:81
BIORBD_NAMESPACE::utils::Benchmark::m_counts
std::map< String, int > m_counts
Counts.
Definition
Benchmark.h:82
BIORBD_NAMESPACE::utils::Benchmark::stopTimer
double stopTimer(const String &name)
Stop the timer of a specified name and get lap time.
Definition
Benchmark.cpp:25
BIORBD_NAMESPACE::utils::Benchmark::addTimer
void addTimer(const String &name)
Add a new timer to the timer set.
Definition
Benchmark.cpp:37
BIORBD_NAMESPACE::utils::Benchmark::getLap
double getLap(const String &name)
Get lap time of a specified timer.
Definition
Benchmark.cpp:21
BIORBD_NAMESPACE::utils::Benchmark::getTimerIdx
int getTimerIdx(const String &name)
Get the index of the specified timer.
Definition
Benchmark.cpp:41
BIORBD_NAMESPACE::utils::Benchmark::pauseTimer
void pauseTimer(const String &name)
Pause a timer of a specified name.
Definition
Benchmark.cpp:29
BIORBD_NAMESPACE::utils::Benchmark::startTimer
void startTimer(const String &name, bool force=false)
Start the timer of a specified name.
Definition
Benchmark.cpp:13
BIORBD_NAMESPACE::utils::String
Wrapper around the std::string class with augmented functionality.
Definition
String.h:18
BIORBD_NAMESPACE::utils::Timer
Wrapper around timer function in C++.
Definition
Timer.h:15
include
Utils
Benchmark.h
Generated by
1.18.0