Skip to content

Commit e3f809c

Browse files
committed
Time variable update bugfix #3
1 parent 77e1529 commit e3f809c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Agenda.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ void Agenda::remove(int id) {
8484
}
8585

8686
void Agenda::update() {
87+
// Save time once to reduce execution time
8788
unsigned long time = micros();
8889
for(byte i = 0; i < max_tasks; i++)
8990
if(!_tasks[i].empty && _tasks[i].active)
@@ -92,6 +93,9 @@ void Agenda::update() {
9293
_tasks[i].execution();
9394
if(_tasks[i].once)
9495
this->remove(i);
96+
time = micros();
97+
/* Bring time variable back coherent after
98+
task execution */
9599
}
96100
}
97101

0 commit comments

Comments
 (0)