Chapter 93. timer
This is a mulit-threaded timer implementation which can create a timer to call an event-handling function at a specific time or at a regular interval.
timer
Description
Type Tags
timer
Object Value
Objects of type timer have no value, and it is an error to try to get or set this value.
timer.new()
Description
Prototype
timer
.new
(
timer
,
datetime me
,
integer alarm
,
integer repeat
)
interval
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
me | None | timer | |
alarm | None | datetime | |
repeat | None | integer | |
interval | None | integer |
Properties
Property | Type | Description |
---|---|---|
_ | type(*) | |
__ | type(*) | |
_private | timerprivate | |
getinfo | function | |
ontimer | event | |
setinfo | function | |
start | function | |
started | boolean | |
stop | function | |
type | type |
Methods
getinfo()
Description
Prototype
timervar
.getinfo
(
timer
)
me
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
me | None | timer |
setinfo()
Description
Prototype
timervar
.setinfo
(
timer
,
datetime me
,
integer alarm
,
integer repeat
,
integer interval
)
microinterval
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
me | None | timer | |
alarm | None | datetime | |
repeat | None | integer | |
interval | None | integer | |
microinterval | 10000 | integer |
start()
Description
Prototype
timervar
.start
(
timer
)
me
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
me | None | timer |
stop()
Description
Prototype
timervar
.stop
(
timer
)
me
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
me | None | timer |