Skip to content

Commit

Permalink
Store Doxygen to master
Browse files Browse the repository at this point in the history
  • Loading branch information
bradamiller committed Mar 30, 2021
1 parent 16e4b43 commit ca599d1
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/Timer.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,39 @@
#pragma once

/**
* @brief A Timer that remembers a starting time and interval allow easy periodic events
*
* This class is for simple timing of things in the loop function where it will determine
* if some amount of time has elapsed. When it is checked after the time has elapsed
* then the timer is reset to simplify restarting the next interval.
* Think of printing periodically.
*/
class Timer
{
public:
/**
* @brief Construct a new Timer object
*
* @param interval
*/
Timer(unsigned long interval);
/**
* @brief Checks to see if the timer has expired.
*
* @return true If the timer has expired, and the timer is reset for another interval.
* @return false If the timer has not expired.
*/
bool isExpired();
/**
* @brief Reset the timer to the current time + interval.
*
*/
void reset();
/**
* @brief Reset the timer with a new interval
*
* @param newInterval
*/
void reset(unsigned long newInterval);

private:
Expand Down

0 comments on commit ca599d1

Please sign in to comment.