# Frost::Profiler Class Reference

The profiling class. More...

`#include <frost_utils_profiler.h>`

List of all members.

## Public Member Functions

| Profiler ()
| Default constructor.
| Profiler (const s_uint &iGroup, const s_str &sName, const s_bool &bRecord)
| Constructor.
void | AddTiming (const s_double &dTiming)
| Adds a timing.
void | PrintProfile (const s_double &dTotal)
| Prints timing infos.
void | SetKeepRecords (const s_bool &bRecord)
| Switches timings recording.
const s_uint & | GetGroup ()
| Returns this profiler's group.

## Static Public Attributes

static const s_str | CLASS_NAME = "Profiler"

## Private Attributes

s_str | sName_
s_uint | uiGroup_
s_double | dStartTime_
s_double | dTotalTime_
s_double | dHighestTime_
s_double | dLowestTime_
s_uint | uiCallNbr_
s_uint | uiZeroTimings_
s_bool | bRecord_
std::vector< s_double > | lRecordStack_

## Detailed Description

The profiling class.

A profiler should be assigned to a single function or portion of code. It will accumulate timings from every Chrono created from it.

Definition at line 21 of file frost_utils_profiler.h.

## Constructor & Destructor Documentation

Frost::Profiler::Profiler | ( |  | ) |

Default constructor.

Definition at line 20 of file frost_utils_profiler.cpp.

Frost::Profiler::Profiler | ( | const s_uint & | iGroup,
|  | const s_str & | sName,
|  | const s_bool & | bRecord |
| ) |  |  |

Constructor.

Parameters:

  | iGroup | The group to which it belongs (used to group prints later)
  | sName | The name of this Profiler (usualy the name of the function it profiles)
  | bRecord | Store all timings in a list to print them later

Definition at line 24 of file frost_utils_profiler.cpp.

## Member Function Documentation

void Frost::Profiler::AddTiming | ( | const s_double & | dTiming | ) |

Adds a timing.

Parameters:

  | dTiming | The timing

Definition at line 36 of file frost_utils_profiler.cpp.

const s_uint & Frost::Profiler::GetGroup | ( |  | ) |

Returns this profiler's group.

Returns:
  This Profiler's group

Definition at line 87 of file frost_utils_profiler.cpp.

void Frost::Profiler::PrintProfile | ( | const s_double & | dTotal | ) |

Prints timing infos.

Parameters:

  | dTotal | The total profiling time, used to calculate percentages.

Definition at line 61 of file frost_utils_profiler.cpp.

void Frost::Profiler::SetKeepRecords | ( | const s_bool & | bRecord | ) |

Switches timings recording.

Definition at line 56 of file frost_utils_profiler.cpp.

## Member Data Documentation

s_bool Frost::Profiler::bRecord_`[private]`

Definition at line 66 of file frost_utils_profiler.h.

const s_str Frost::Profiler::CLASS_NAME = "Profiler"`[static]`

Definition at line 54 of file frost_utils_profiler.h.

s_double Frost::Profiler::dHighestTime_`[private]`

Definition at line 62 of file frost_utils_profiler.h.

s_double Frost::Profiler::dLowestTime_`[private]`

Definition at line 63 of file frost_utils_profiler.h.

s_double Frost::Profiler::dStartTime_`[private]`

Definition at line 60 of file frost_utils_profiler.h.

s_double Frost::Profiler::dTotalTime_`[private]`

Definition at line 61 of file frost_utils_profiler.h.

std::vector<s_double> Frost::Profiler::lRecordStack_`[private]`

Definition at line 68 of file frost_utils_profiler.h.

s_str Frost::Profiler::sName_`[private]`

Definition at line 58 of file frost_utils_profiler.h.

s_uint Frost::Profiler::uiCallNbr_`[private]`

Definition at line 64 of file frost_utils_profiler.h.

s_uint Frost::Profiler::uiGroup_`[private]`

Definition at line 59 of file frost_utils_profiler.h.

s_uint Frost::Profiler::uiZeroTimings_`[private]`

Definition at line 65 of file frost_utils_profiler.h.

The documentation for this class was generated from the following files:

- D:/Programmation/Sources/Tensor2/Utils/include/frost_utils_profiler.h
- D:/Programmation/Sources/Tensor2/Utils/src/frost_utils_profiler.cpp