# Frost::Timer Class Reference

A simple timer. More...

`#include <frost_utils_timers.h>`

List of all members.

## Public Types

enum | StartType { START_PAUSED, START_NOW }

## Public Member Functions

| Timer (const StartType &mType=START_PAUSED)
| Constructor.
void | AddTime (const s_double &dAdditionnalTime)
| Adds time to this Timer.
void | SetTime (const s_double &dTime)
| Sets the current elapsed time for this Timer.
s_double | GetElapsed ()
| Returns the total time elapsed.
const s_bool & | IsPaused () const
| Cheks if this Timer is paused.
void | Start (const s_bool &bReset=false)
| Starts this timer.
void | Pause ()
| Pauses this timer.
void | Stop ()
| Stops this timer.
void | Zero ()
| Resets this timer (doesn't pause it).

## Static Public Attributes

static const s_str | CLASS_NAME = "Timer"

## Private Attributes

s_double | dElapsed_
s_double | dStart_
s_bool | bPaused_

## Detailed Description

A simple timer.

Definition at line 89 of file frost_utils_timers.h.

## Member Enumeration Documentation

enum Frost::Timer::StartType

Enumerator:

  START_PAUSED | The timer will start if you call Start().
  START_NOW | The timer starts immediatly after it is created.

Definition at line 93 of file frost_utils_timers.h.

## Constructor & Destructor Documentation

Frost::Timer::Timer | ( | const StartType & | mType = `START_PAUSED` | ) |

Constructor.

Definition at line 104 of file frost_utils_timers.cpp.

## Member Function Documentation

void Frost::Timer::AddTime | ( | const s_double & | dAdditionnalTime | ) |

Adds time to this Timer.

Parameters:

  | dAdditionnalTime | The time to add (can be negative)

Definition at line 112 of file frost_utils_timers.cpp.

s_double Frost::Timer::GetElapsed | ( |  | ) |

Returns the total time elapsed.

Returns:
  The total time elapsed.

Definition at line 123 of file frost_utils_timers.cpp.

const s_bool & Frost::Timer::IsPaused | ( |  | ) | const

Cheks if this Timer is paused.

Returns:
  'true' if this Timer is paused

Definition at line 131 of file frost_utils_timers.cpp.

void Frost::Timer::Pause | ( |  | ) |

Pauses this timer.

Definition at line 150 of file frost_utils_timers.cpp.

void Frost::Timer::SetTime | ( | const s_double & | dTime | ) |

Sets the current elapsed time for this Timer.

Parameters:

  | dTime | The new elapsed time

Definition at line 117 of file frost_utils_timers.cpp.

void Frost::Timer::Start | ( | const s_bool & | bReset = `false` | ) |

Starts this timer.

Definition at line 142 of file frost_utils_timers.cpp.

void Frost::Timer::Stop | ( |  | ) |

Stops this timer.

Definition at line 136 of file frost_utils_timers.cpp.

void Frost::Timer::Zero | ( |  | ) |

Resets this timer (doesn't pause it).

Definition at line 159 of file frost_utils_timers.cpp.

## Member Data Documentation

s_bool Frost::Timer::bPaused_`[private]`

Definition at line 142 of file frost_utils_timers.h.

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

Definition at line 136 of file frost_utils_timers.h.

s_double Frost::Timer::dElapsed_`[private]`

Definition at line 140 of file frost_utils_timers.h.

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

Definition at line 141 of file frost_utils_timers.h.

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

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