Case File: The Clock That Rolls Over
A controller that runs for weeks and then misbehaves every fifty days is the classic result of a time comparison that was not written for the moment the millisecond counter wraps. Run periodic tasks from a list of counter readings, using an elapsed time computed with an unsigned subtraction, count how many times each task runs, how many times the counter wraps and the total elapsed time, and work out how many days pass until a wrap. Run it on readings that you cannot see. The readings are generated for you alone.
Case File: The Clock That Rolls Over
A controller that runs for weeks and then misbehaves every fifty days is the classic result of a time comparison that was not written for the moment the millisecond counter wraps. Run periodic tasks from a list of counter readings, using an elapsed time computed with an unsigned subtraction, count how many times each task runs, how many times the counter wraps and the total elapsed time, and work out how many days pass until a wrap. Run it on readings that you cannot see. The readings are generated for you alone.
In this lesson:
- millis
- timing
- overflow
- scheduler
- python
- case-file
This lesson is part of a paid plan
Upgrade to Pro to unlock this course, its labs and its exam.
View Pricing Plans