Simple profiler.
More...
#include <Profiler.h>
|
using | clock_t = std::chrono::high_resolution_clock |
|
using | dur_t = std::chrono::nanoseconds |
|
Simple profiler.
- Author
- Michael Imamura
HoverRace::Util::Profiler::Profiler |
( |
| ) |
|
|
delete |
HoverRace::Util::Profiler::Profiler |
( |
const std::string & |
name | ) |
|
std::shared_ptr< Profiler > HoverRace::Util::Profiler::AddSub |
( |
const std::string & |
name | ) |
|
Add a new subset.
- Parameters
-
name | The name of the subset. |
- Returns
- The created subset (never
nullptr
).
dur_t HoverRace::Util::Profiler::GetDuration |
( |
| ) |
const |
|
inline |
const LapTime& HoverRace::Util::Profiler::GetLastLap |
( |
| ) |
const |
|
inline |
const std::string& HoverRace::Util::Profiler::GetName |
( |
| ) |
const |
|
inline |
const LapTime& HoverRace::Util::Profiler::GetOtherTime |
( |
| ) |
const |
|
inline |
Retrieve the unaccounted-for time from the last call to Lap().
- Returns
- The other time.
Calculate the statistics for the current period, then reset the counters to start the next period.
- Parameters
-
parent | The parent profiler (nullptr if this is the root profiler). |
- Returns
- The lap statistics (also available via GetLastLap()).
void HoverRace::Util::Profiler::Reset |
( |
| ) |
|
Resets the accumulated time.
All subsets are also reset.
dur_t HoverRace::Util::Profiler::dur |
|
private |
LapTime HoverRace::Util::Profiler::lap |
|
private |
std::string HoverRace::Util::Profiler::name |
|
private |
LapTime HoverRace::Util::Profiler::otherTime |
|
private |
clock_t::time_point HoverRace::Util::Profiler::sampleStart |
|
private |
int HoverRace::Util::Profiler::sampling |
|
private |
std::vector<std::shared_ptr<Profiler> > HoverRace::Util::Profiler::subs |
|
private |
The documentation for this class was generated from the following files: