-
Notifications
You must be signed in to change notification settings - Fork 0
stdtime
Timer related services.
Opaque type timer represents timer data structure.
Opaque type ticker represents ticker data structure. Ticker is used for periodical timing.
Calling fiber sleeps N seconds, where N is given as argument (argument type is int).
type: procedure
Format:
call(stdtime.sleep <int>) -> true
Return value: true
Calling fiber sleeps N nanoseconds, where N is given as argument (argument type is int).
type: procedure
Format:
call(stdtime.nanosleep <int>) -> true
Return value: true
Creates timer, caller gives time limit, channel and value as arguments. When timer expires given value is written to given channel.
type: procedure
Arguments:
- time limit (int)
- channel
- value which is sent to channel when timer expires
Format:
call(stdtime.newtimer <int> <channel> <value>) -> <timer>
Return value: timer value
Creates timer, caller gives time limit and procedure which is called when timer expires.
type: procedure
Format:
call(stdtime.callafter <int> <handler-proc>) -> <timer>
Return value: timer value
Stops timer that is given as argument.
type: procedure
Format:
call(stdtime.stoptimer <timer>) -> <bool>
Return value: true if timer was found, false otherwise
Creates ticker, caller gives tick-period, channel and value as arguments. When tick happens given value is written to given channel.
type: procedure
Arguments:
- ticker period (int)
- channel
- value which is sent to channel when tick happens
Format:
call(stdtime.newticker <int> <channel> <value>) -> <ticker>
Return value: ticker value
Stops ticker that is given as argument.
type: procedure
Format:
call(stdtime.stopticker <ticker>) -> true
Return value: true