wpi-32u4-library
Public Member Functions | Private Attributes
Timer Class Reference

#include <Timer.h>

Public Member Functions

 Timer (unsigned long interval)
 
bool isExpired ()
 
void reset ()
 
void reset (unsigned long newInterval)
 

Private Attributes

unsigned long expiredTime
 
unsigned long timeInterval
 

Detailed Description

Definition at line 3 of file Timer.h.

Constructor & Destructor Documentation

◆ Timer()

Timer::Timer ( unsigned long  interval)

Create a timer that will expire every "interval"

Definition at line 7 of file Timer.cpp.

References expiredTime, and timeInterval.

Member Function Documentation

◆ isExpired()

bool Timer::isExpired ( )

Check if the timer is expired, that is the current time is past the expired time.

Definition at line 35 of file Timer.cpp.

References expiredTime, and timeInterval.

◆ reset() [1/2]

void Timer::reset ( )

Reset the timer to that the expired time is the current time + interval

Definition at line 16 of file Timer.cpp.

References expiredTime, and timeInterval.

Referenced by reset().

◆ reset() [2/2]

void Timer::reset ( unsigned long  newInterval)

Change the timer interval to "NewInterval" then reset the timer to that the expired time is the current time + interval

Definition at line 25 of file Timer.cpp.

References reset(), and timeInterval.

Field Documentation

◆ expiredTime

unsigned long Timer::expiredTime
private

Definition at line 12 of file Timer.h.

Referenced by isExpired(), reset(), and Timer().

◆ timeInterval

unsigned long Timer::timeInterval
private

Definition at line 13 of file Timer.h.

Referenced by isExpired(), reset(), and Timer().


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