⌂ Modules nupp nupp.time nupp.time
nupp.time provides clocks and waits from the current host.
now is the clock durations and deadlines are measured in. It only moves forward and its zero is whatever the host picked, so one reading means nothing except against another. wallTime is calendar time and may jump backwards when the machine's clock is corrected. Never subtract two of those to measure how long something took.
Submodules Module Description nupp.time.spiImplementation interfaces consumed during ordinary module initialization.
Module contents Functions Function Kind Description nowfunction Returns monotonic milliseconds, the domain durations and deadlines use. sleepfunction Waits for a finite, non-negative interval through the suspension context. sleepUntilfunction Waits until a non-negative deadline in the now domain. wakeAtfunction Schedules a callback for a non-negative deadline in the now domain. wallTimefunction Returns milliseconds since the Unix epoch.
Functions
nowfunction
const now : function ( ) : number
Returns monotonic milliseconds, the domain durations and deadlines use.
Returns
sleepfunction
const sleep : function ( milliseconds : number ) : nil
Waits for a finite, non-negative interval through the suspension context.
Arguments Name Type Description millisecondsnumber
Returns
Raises Type Condition string when the interval is invalid or cannot be scheduled
sleepUntilfunction
Waits until a non-negative deadline in the now domain.
A deadline already past returns without waiting.
Arguments Name Type Description deadlinenumber
Returns
Raises Type Condition string when the deadline is invalid or cannot be scheduled
wakeAtfunction
const wakeAt : function ( deadline : number , resume : function ( boolean ) : nil ) : function ( ) : nil
Schedules a callback for a non-negative deadline in the now domain.
Returns a function that when called cancels the scheduled callback. Registration itself does not suspend.
Arguments Name Type Description deadlinenumber resumefunction ( boolean ) : nil
Returns Type Description function ( ) : nil
Raises Type Condition string when the deadline is invalid or cannot be scheduled
wallTimefunction
Returns milliseconds since the Unix epoch.
Returns
← Previous nupp.text.utf8 Next → nupp.time.spi