clan::Timer Class Reference - ClanLib SDK
Description: clan::Timer Class Reference

Public Member Functions | List of all members
clan::Timer Class Reference

Timer class that invokes a callback on a specified interval. More...

`#include <timer.h>`

## Public Member Functions
| Timer ()
| Creates a timer object.
std::function< void()> & | func_expired ()
| Callback invoked every time the timer interval occurs.
unsigned int | get_timeout () const
| Returns the current timeout. In milliseconds.
bool | is_repeating () const
| Returns true if the timer repeats until it is stopped.
void | start (unsigned int timeout, bool repeat=true)
| Starts the timer. Timeout in milliseconds.
void | stop ()
| Stop the timer.

## Detailed Description

Timer class that invokes a callback on a specified interval.

## Constructor & Destructor Documentation

## ◆ Timer()

clan::Timer::Timer | ( |  | ) |

Creates a timer object.

## Member Function Documentation

## ◆ func_expired()

std::function< void()> & clan::Timer::func_expired | ( |  | ) |

Callback invoked every time the timer interval occurs.

## ◆ get_timeout()

unsigned int clan::Timer::get_timeout | ( |  | ) | const

Returns the current timeout. In milliseconds.

## ◆ is_repeating()

bool clan::Timer::is_repeating | ( |  | ) | const

Returns true if the timer repeats until it is stopped.

## ◆ start()

void clan::Timer::start | ( | unsigned int | timeout,
|  | bool | repeat = true )

Starts the timer. Timeout in milliseconds.

## ◆ stop()

void clan::Timer::stop | ( |  | ) |

Stop the timer.

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

- timer.h