IRremoteESP8266

Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
IRtimer Class Reference

This class offers a simple counter in micro-seconds since instantiated. More...

`#include <IRtimer.h>`

## Public Member Functions
| IRtimer ()
| Class constructor. More...
void | reset ()
| Resets the IRtimer object. I.e. The counter starts again from now. More...
uint32_t | elapsed ()
| Calculate how many microseconds have elapsed since the timer was started. More...

## Static Public Member Functions
static void | add (uint32_t usecs)
| Add time to the timer to simulate elapsed time. More...

## Private Attributes
uint32_t | start
| Time in uSeconds when the class was instantiated/reset. More...

## Detailed Description

This class offers a simple counter in micro-seconds since instantiated.

Note
  Handles when the system timer wraps around (once).

## Constructor & Destructor Documentation

## ◆ IRtimer()

IRtimer::IRtimer | ( |  | ) |

Class constructor.

## Member Function Documentation

## ◆ add()

void IRtimer::add | ( | uint32_t | usecs | ) |
| static

Add time to the timer to simulate elapsed time.

Parameters

  [in] | usecs | Nr. of uSeconds to be added.

Note
  Only used in unit testing.

## ◆ elapsed()

uint32_t IRtimer::elapsed | ( |  | ) |

Calculate how many microseconds have elapsed since the timer was started.

Returns
  Nr. of microseconds.

## ◆ reset()

void IRtimer::reset | ( |  | ) |

Resets the IRtimer object. I.e. The counter starts again from now.

## Member Data Documentation

## ◆ start

uint32_t IRtimer::start
| private

Time in uSeconds when the class was instantiated/reset.

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

- src/IRtimer.h
- src/IRtimer.cpp