Skip to content

Add a wall clock Timer #584

Open
Open

Description

@llucax

What's needed?

A Timer that ticks following the wall clock instead of the event loop's monotonic clock, for example to tick at the start of every minute, and that copes with the wall clock jumping or drifting.

#582 renames the current Timer to MonotonicTimer in v1.13.0, and v2.0.0 removes the deprecated name (#365), which frees Timer for this. Adding it isn't a breaking change, so it can come in any v2 minor, after v2.0.0.

Proposed solution

Start from the SDK's WallClockTimer, which the resampler already uses.

Code that still uses the deprecated 1.x Timer when upgrading should fail loudly rather than silently switch clocks, so the new Timer shouldn't accept the old Timer(interval, missed_tick_policy) call as it is.

Additional context

As I said in #365, once there is a wall clock timer, MonotonicTimer can probably lose features that only exist to build wall clock timers on top of it, like start_delay. Removing them is a breaking change, tracked in #581, together with tick_on_init, which could fit in this design too.

Activity

  1. added this to the Untriaged milestone on Nov 5, 2026
  2. added
    type:enhancement
    part:utilities
    on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    part:utilitiestype:enhancement

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions