5#include "ustd_platform.h"
49 unsigned long timerStart;
50 unsigned long beatLength;
53 heartbeat(
unsigned long length = 0) : beatLength{length} {
57 timerStart = millis();
68 operator unsigned long()
const {
81 unsigned long now = millis();
83 if (beatLength && diff >= beatLength) {
84 timerStart = now - (diff % beatLength);
85 return diff / beatLength;
97 unsigned long now = millis();
99 if (beatLength && diff >= beatLength) {
101 return diff / beatLength;
muwerk HeartBeat Class
Definition heartbeat.h:47
unsigned long beat()
Definition heartbeat.h:75
unsigned long elapsed()
Definition heartbeat.h:90
heartbeat(unsigned long length=0)
Definition heartbeat.h:53
heartbeat & operator=(const unsigned long length)
Definition heartbeat.h:60
The muwerk namespace.
Definition console.h:15
unsigned long timeDiff(unsigned long first, unsigned long second)
Definition muwerk.h:44