#define TICK_RATE 1000
// uint32_t glNexTick = 0;
// uint32_t glCount = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("System ready");
}
void loop() {
// put your main code here, to run repeatedly:
uint32_t static count = 0;
uint32_t static nextTick = 0;
uint32_t now = millis();
if (nextTick <= now) { // 0 318169 636324 954152
nextTick += TICK_RATE;
Serial.println(count);
}
// if (nextTick <= now) { // 0 318169 636323 954151
// nextTick = millis() + TICK_RATE;
// Serial.println(count);
// }
// if (nextTick <= now) { // 0 318169 636324 954152
// nextTick = now + TICK_RATE;
// Serial.println(count);
// }
// if (glNexTick <= now) { // 0 318169 636324 954152
// glNexTick += TICK_RATE;
// Serial.println(glCount);
// }
// if (now - nextTick <= TICK_RATE) { // 0 294601 589189 883475
// nextTick += TICK_RATE;
// Serial.println(count);
// }
count++;
// glCount++;
}