The Machines · Runtime stack

seedclock

A reckoner seed: clock — machines/seeds/seedclock.shoddy

the seedclock machine's icon

Summary

seedclock bridges clock — that is, it makes the machine's words callable from the reckoner calculator: STAMP STAMPDATE STAMPTIME TICKS ELAPSED FORMATDURATION. TimeIt is not bridged. It takes a quotation (a block of code passed around as a value), and a bridged word that wants a function is a word that isn't bridged — a combinator covers the case instead. None of TIMES/MAP/FILTER/FOLD answers a duration. So to time something, a program reaches for TICKS before and ELAPSED after.

Why It's Useful

Every word here is total — it always answers and cannot fail. Stamp, StampDate, StampTime and Ticks cannot fail, and FormatDuration is arithmetic and string formatting over whatever number it is given. So this seed carries no guards (checks that turn a failure into a reported error) of its own. STAMP, STAMPDATE, STAMPTIME and TICKS touch the world; FORMATDURATION does not. Reading the clock answers something different from one call to the next, exactly as reading a file does. Formatting a number already on the stack (the calculator's working pile of values) touches nothing.

User's Guide

Let st0 = RckSeedClock(RckNew())
RckEval(st0, "TICKS")            ' x: milliseconds since the program started
RckEval(st0, "STAMP")            ' x: "2026-08-05T14:03:11.204"
RckEval(st0, "64200 FORMATDURATION")   ' x: "1m 04.2s"

Word Reference

WordDescription
STAMP ( -- s )The current date and time, in ISO-8601 form (the international date format shown above).
STAMPDATE ( -- s )The current date, YYYY-MM-DD.
STAMPTIME ( -- s )The current time of day, HH:MM:SS.mmm.
TICKS ( -- n )Milliseconds since the program started. The count only ever goes up (monotonic), so it is for measuring, not stamping.
ELAPSED ( since -- ms )Milliseconds passed since the TICKS value since was taken.
FORMATDURATION ( ms -- s )ms written as a duration, e.g. "1m 04.2s".

Who Uses It

UserHow
halifaxThe calculator's date and duration words: STAMP, STAMPDATE, STAMPTIME, TICKS, ELAPSED and FORMATDURATION.
sparkySparky folds it too, so a model calling eval reaches the same words halifax puts at a prompt.

A mill claims this seed by folding RckSeedClock over its reckoner state, which is all halifax does.

The Machines It Uses

MachineWhy
clockThe domain this seed bridges: Stamp, StampDate, StampTime, Ticks, Elapsed and FormatDuration.
cuttleThe Cell type every word here reads and answers.
reckonerRckReg, RckSeeding and the argument readers every registered word is built from.