cowboy_sdk.std.clock measures the chain’s block rate in the actor’s own storage as the actor runs, and turns a block-time target into the height to arm a timer at.
height_at(storage, at_ms, max_blocks=MAX_TIMER_BLOCKS)is at least the next block and at mostmax_blocksahead. The default, 2,500,000, sits below the default timer TTL (cip5.timer.max_ttl_blocks, 2,592,000). The TTL is governed, so on a chain that lowers it, pass your ownmax_blocks. A target further out lands early.ms_per_block(storage)is the rate it uses. Until two calls at leastMEASURE_BLOCKS(600) apart have measured it, the rate isBLOCK_MS(1,000). A measurement is clamped to 100 to 10,000 ms.- The measurement is one storage key,
std.clock, holding[height, timestamp_ms, ms_per_block].
runtime.get_timestamp_ms() with its target when the timer fires, and re-arms with height_at if it is early.
For a fixed period, @every and runtime.schedule_after already re-arm an early timer for you. Use std.clock for a calendar target, such as the next 07:00 UTC.