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

Variables
state

Useful for creating an initial timerState where lastPulse is 0

Type
timerState
Functions
every

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

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

The interval between values firing

state : inout timerState

Holds the last time that the signal fired

Returns

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