Repair Monotonic Clock Bugs

    by Mariusz Wrzeszczynski

    1

    Repair wall-clock misuse in elapsed durations, deadlines, retry delays, local TTLs, leases, and latency metrics while preserving real UTC timestamps.

    Secure checkout via Stripe

    0 installsSecurity scanned

    Works with the AI tools you already use

    CClaude CodeCCursorCCodex CLIGGitHub CopilotGGemini CLI+17 more

    See it in action

    You say

    Our Go service measures request latency with time.Now(), stores start.UnixMilli(), then later subtracts it from another wall-clock UnixMilli value. The same helper calculates an in-process timeout deadline. In a fake-clock test, moving wall time backward by 90 seconds produces negative latency and extends the deadline. Repair locally while preserving all current timeout values and persisted audit timestamps. Do not change the machine clock or NTP configuration.

    Your agent does

    Clock-domain bug found. Wall Unix timestamps are used for elapsed latency and in-process deadlines, so a backward clock step produces negative duration and extends the timeout. The repair uses monotonic elapsed/deadline primitives while preserving UTC audit timestamps and all existing duration values.

    What you get

    Migrate elapsed-time logic from wall-clock to monotonic clock sources.Prevent timeout extensions caused by NTP synchronization jumps.Fix race conditions in local cache TTL and rate-limiting logic.Implement deterministic clock-jump tests for CI/CD reliability.

    About this skill

    Wall time can jump. NTP corrections, VM resume, manual clock changes, or test rewinds can make elapsed durations negative, extend timeouts, or expire process-local cache entries too early. The fix is not to replace every timestamp with a monotonic clock.

    Repair Monotonic Clock Bugs classifies each time value by meaning, moves only in-process elapsed/deadline math to monotonic sources, preserves UTC wall timestamps for audit and external protocols, prevents mixed-clock subtraction, and proves behavior with deterministic forward/backward clock-jump tests.

    Configured timeout and TTL values remain unchanged.

    How to install

    Drop the file into your AI Agent. Works with Claude, Cursor, ChatGPT, and 20+ more.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean today

    Listedtoday

    Frequently Asked Questions

    Popular in Testing & QA