Prusa3d Marlin fork
|
simple timer More...
#include <Timer.h>
Public Member Functions | |
void | start () |
Start timer. | |
void | stop () |
bool | running () const |
bool | expired (T msPeriod) |
Timer has expired. More... | |
T | elapsed () |
Ticks since the timer was started. More... | |
bool | expired_cont (T msPeriod) |
Protected Member Functions | |
T | started () const |
Simple and memory saving implementation. Should handle timer register wrap around well. Resolution is one millisecond. To save memory, doesn't store timer period. If you wish timer which is storing period, derive from this.
T Timer< T >::elapsed |
This function returns 0 if the timer is not started. Otherwise, it returns the time in milliseconds since the timer was started. This function is expected to handle wrap around of time register well. The maximum elapsed time is dictated by the template type
bool Timer< T >::expired | ( | T | msPeriod | ) |
Timer is considered expired after msPeriod has passed from time the timer was started. Timer is stopped after expiration. This function must be called at least each (T maximum value - msPeriod) milliseconds to be sure to catch first expiration. This function is expected to handle wrap around of time register well.
msPeriod | Time interval in milliseconds. Do not omit "ul" when using constant literal with LongTimer. |