Skip to content

Use a monotonic clock for timer scheduling - #1

Merged
esrrhs merged 2 commits into
masterfrom
copilot/check-for-bugs
May 23, 2026
Merged

esrrhs merged 2 commits into
masterfrom
copilot/check-for-bugs

Conversation

Copilot AI commented May 23, 2026

Copy link
Copy Markdown
Contributor

WheelTimer was basing scheduling on wall-clock time, so system time adjustments could skew expiration timing. This change switches timer bookkeeping to a monotonic clock so deadlines remain stable across clock jumps.

  • Clock source

    • Replace std::chrono::system_clock with std::chrono::steady_clock for:
      • timer insertion timestamps
      • update-time tick calculation
      • internal start time tracking
  • Behavioral impact

    • Timer expiry is now derived from elapsed time only
    • Wall-clock changes no longer cause timers to fire early, late, or stall unexpectedly
  • Repository hygiene

    • Ignore the local build/ directory to avoid tracking generated artifacts from local CMake builds
using Clock = std::chrono::steady_clock;

auto now = Clock::now();
Clock::time_point startTime_ = Clock::now();

Copilot AI and others added 2 commits May 23, 2026 12:41
Agent-Logs-Url: https://github.com/esrrhs/wheel_timer/sessions/cc984223-8240-47ae-a937-8f9a2b5350b3

Co-authored-by: esrrhs <4083816+esrrhs@users.noreply.github.com>
Agent-Logs-Url: https://github.com/esrrhs/wheel_timer/sessions/cc984223-8240-47ae-a937-8f9a2b5350b3

Co-authored-by: esrrhs <4083816+esrrhs@users.noreply.github.com>
@esrrhs
esrrhs marked this pull request as ready for review May 23, 2026 12:46
@esrrhs
esrrhs merged commit 5716f2b into master May 23, 2026
1 check passed
@esrrhs
esrrhs deleted the copilot/check-for-bugs branch May 23, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants