Time

Summary
Time
Functions
waitPauses the program for the amount of time (in milliseconds) given as the parameter.
nowGives the number of milliseconds that has passed since the program began running.
Types
timerStateHolds the state for the every functions
Functions
stateCreates a new timerState
everyProduces a signal of millisecond time stamps which fires in a time delay of the given interval.

Functions

wait

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

Type Signature

(uint32) -> unit

Parameters

time : uint32The 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

timerState

Holds the state for the every functions

timerState

Members

lastPulse : uint32Timestamp 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 : uint32The interval between values firing
state : timerState refHolds the last time that the signal fired

Returns

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

Holds the state for the every functions
Close