Time
Functions
wait

Pauses the program for the amount of time (in milliseconds) given as the parameter.

Type Signature
(uint32) -> unit
Parameters
time : uint32

The amount of time to sleep

now

Gives the number of milliseconds that has passed since the program began running. Useful as a time stamp.

Type Signature
() -> uint32
Returns

The time elapsed

Types
alias timerState

Holds the state for the every functions

alias timerState = { lastPulse : uint32 }
Members
lastPulse : uint32

Timestamp of the last pulse

Functions
state

Creates a new <timerState>

Type Signature
(||)() -> timerState ref
Returns

A <timerState> with lastPulse set to 0

every

Produces a signal of millisecond time stamps which fires in a time delay of the given interval.

Type Signature
(||)(uint32, timerState ref) -> sig<uint32>
Parameters
interval : uint32

The interval between values firing

state : timerState ref

Holds the last time that the signal fired

Returns

A signal of timestamps which carries a value every interval milliseconds.