# Frost::Chrono Class Reference

An automatic timer. More...

`#include <frost_utils_profiler.h>`

List of all members.

## Public Member Functions

| Chrono (s_ptr< Profiler > pProfiler, const s_bool &bStart=true)
| Constructor.
| ~Chrono ()
| Destructor.
s_double | GetTime ()
| Returns the time elapsed since its creation.
void | Start ()
| Restarts a timer after it has been stopped.
void | Stop (const s_bool &bSend=true)
| Stops this timer and add its timing to the profiler.

## Static Public Attributes

static const s_str | CLASS_NAME = "Chrono"

## Private Attributes

s_ptr< Profiler > | pParent_
s_double | dStart_
s_double | dTotal_
s_bool | bStopped_

## Detailed Description

An automatic timer.

This timer starts when you create it and ends at destruction or when you call Stop().
So, to use it, the simplest way is to call :
Chrono c = Chrono(TimeManager::GetProfiler(...));
And when c will be destroyed, it will add a timing to the profiler you gave in the constructor.
Note : This class should only be used for profiling purposes.

Definition at line 81 of file frost_utils_profiler.h.

## Constructor & Destructor Documentation

Frost::Chrono::Chrono | ( | s_ptr< Profiler > | pProfiler,
|  | const s_bool & | bStart = `true` |
| ) |  |  |

Constructor.

Parameters:

  | pProfiler | The profiler that will be linked to this Chrono
  | bStart | 'true' to make it start immediately

Definition at line 92 of file frost_utils_profiler.cpp.

Frost::Chrono::~Chrono | ( |  | ) |

Destructor.

Definition at line 108 of file frost_utils_profiler.cpp.

## Member Function Documentation

s_double Frost::Chrono::GetTime | ( |  | ) |

Returns the time elapsed since its creation.

Returns:
  Elapsed time since its creation

Definition at line 148 of file frost_utils_profiler.cpp.

void Frost::Chrono::Start | ( |  | ) |

Restarts a timer after it has been stopped.

Definition at line 118 of file frost_utils_profiler.cpp.

void Frost::Chrono::Stop | ( | const s_bool & | bSend = `true` | ) |

Stops this timer and add its timing to the profiler.

Parameters:

  | bSend | If set to false, the timer will only be paused and won't send data to the profiler.

Definition at line 130 of file frost_utils_profiler.cpp.

## Member Data Documentation

s_bool Frost::Chrono::bStopped_`[private]`

Definition at line 115 of file frost_utils_profiler.h.

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

Definition at line 108 of file frost_utils_profiler.h.

s_double Frost::Chrono::dStart_`[private]`

Definition at line 113 of file frost_utils_profiler.h.

s_double Frost::Chrono::dTotal_`[private]`

Definition at line 114 of file frost_utils_profiler.h.

s_ptr<Profiler> Frost::Chrono::pParent_`[private]`

Definition at line 112 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