Reference

Time and Timers

Generated from LANGUAGE.md at bf2cba0, 2026-08-22.

Getting Current Time

Get the current date/time as a time value:

Get current time into now.
a time called now is current time.

Time Properties

Access components of a time value using the 's property syntax:

PropertyDescriptionType
hourHour of day (0-23)Number
minuteMinute (0-59)Number
secondSecond (0-59)Number
dayDay of month (1-31)Number
monthMonth (1-12)Number
yearYear (e.g., 2026)Number
unixUnix timestamp (seconds since epoch)Number

Example:

Get current time into now.
Print "Current time: ".
Print the now's hour.
Print ":".
Print the now's minute.
Print ":".
Print the now's second.

Print "Date: ".
Print the now's year.
Print "-".
Print the now's month.
Print "-".
Print the now's day.

Inline Time Access

Access current time properties directly without storing:

Print "It is currently hour ".
Print current time's hour.
Print " of the day.".

Sleep / Wait

Pause program execution for a specified duration:

Wait 1 second.
Wait 2 seconds.
Wait 500 milliseconds.
Sleep for 3 seconds.

Syntax variations:

  • Wait <N> second. / Wait <N> seconds.
  • Wait <N> millisecond. / Wait <N> milliseconds.
  • Sleep for <N> seconds.
  • Sleep for <N> milliseconds.

Timers

Timers are stopwatches for measuring durations. They track start time, end time, and elapsed duration.

Creating a Timer

Create a timer called 'job timer'.
a timer called benchmark.

Starting and Stopping

Start the 'job timer'.
(... do work ...)
Stop the 'job timer'.

Alternative spellings:

  • Start / Begin
  • Stop / Finish

These four words are contextual, not reserved. They open a timer statement only when a name operand follows — Start the t., stop t. — and everywhere else they are ordinary identifiers, so a number called stop is 0. compiles, and a program may define and call its own zero-argument start. function. (End is not a Stop spelling: end belongs to the exit family of keywords and remains reserved.)

Timer Properties

PropertyDescriptionType
durationTotal duration (requires cast)Duration
elapsedElapsed time while running (requires cast)Duration
start timeWhen timer was started (unix timestamp)Number
end timeWhen timer was stopped (unix timestamp)Number
runningWhether timer is currently runningBoolean

Getting Duration

Use in to cast duration to a specific unit:

Print the 'job timer''s duration in seconds.
Print the 'job timer''s duration in milliseconds.
Print the 'job timer''s elapsed in seconds.

Complete Timer Example

(Measure job duration)
Print "Starting job...".
Create a timer called 'job timer'.
Start the 'job timer'.

(... do work ...)
Wait 1 second.
Print "Seconds elapsed so far: ".
Print the 'job timer''s elapsed in seconds.

Wait 500 milliseconds.
Stop the 'job timer'.

Print "Finished the job in: ".
Print the 'job timer''s duration in seconds.
Print " seconds".

(Access raw timestamps)
Print "Started at unix time: ".
Print the 'job timer''s start time.
Print "Stopped at unix time: ".
Print the 'job timer''s end time.

Formatted Time Output

Combine time properties with the zero-pad format specifier (see Format Specifiers) for formatted output. A time property can be read directly inside a format slot:

Get current time into now.
Print "{now's hour:02}:{now's minute:02}:{now's second:02}".
(Prints: 09:05:03)

Or, if you want the parts as named values first:

Get current time into now.
a text called h is "{now's hour:02}".
a text called m is "{now's minute:02}".
a text called s is "{now's second:02}".

Print "{h}:{m}:{s}".
(Prints: 09:05:03)