Tesseract 0.28.4
Loading...
Searching...
No Matches
tesseract::common::Timer Class Reference

A timer which calls a callback every interval on a separate thread. More...

#include <timer.h>

Public Member Functions

 Timer (const Timer &)=delete
Timer & operator= (const Timer &)=delete
 Timer (Timer &&)=delete
Timer & operator= (Timer &&)=delete
void start (const std::function< void()> &callback, std::chrono::steady_clock::duration interval)
 Start the timer with a callback function and a std::chrono::duration interval.
void stop ()
 Stop the timer.

Detailed Description

A timer which calls a callback every interval on a separate thread.

Member Function Documentation

◆ start()

void tesseract::common::Timer::start ( const std::function< void()> & callback,
std::chrono::steady_clock::duration interval )

Start the timer with a callback function and a std::chrono::duration interval.

Parameters
callbackThe callback called every time the timer expires
intervalThe interval at which the timer triggers