Skip to content

CLOCK_TAI or CLOCK_REALTIME instead of CLOCK_MONITONIC/CLOCK_BOOT? #1526

Description

@spacelama

Per (closed) #1019, why are we giving the user or their scripts some arbitrary value for TIMESTAMP, rather than a value that can be directly piped into libraries that can make use of seconds since the epoch?

So the question becomes: why is dunst using CLOCK_MONOTONIC at all? There's plenty of use-cases for specialised precision interval timekeeping, but is showing notifications one of them? Oh no, a leapsecond has happened once every 5 years. Do I really care that my notification came in 65 seconds ago and not 64 seconds ago? You could get away fine with using CLOCK_REALTIME, but heck, if you really care about monotonicity, just use CLOCK_TAI -- it's currently ~38 seconds out from the unix epoch. But at least then $DUNST_TIMESTAMP and dunstctl history | grep -A3 timestamp bear some resemblance to something useful.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions