-
Notifications
You must be signed in to change notification settings - Fork 1
system.timer
load system.timer
This module provides the System.Timer class which provides an awaitable timer implementation.
This enum describe the clock precision.
| Constant | Value | Description ||----------|-------|-------------|
| Monotonic | 0 | |
This class provides an awaitable timer implementation that trigger an event when the timer timeout.
The timer's clock can be adjusted by using a value of the System.Timer.ClockType enum.
This type is not copyable
| Modifiers | Member | Description |
|---|---|---|
enum |
ClockType | This enum describe the clock precision. |
const |
clear | Resets the timeout event. |
const |
getDelay | Returns the timer delay in milliseconds as a number. |
const |
getHandle | Returns the handle used by System.Timer.System.Poller. |
const |
getPeriod | Returns the timer period in milliseconds as a number. |
const |
getPollEvent | Returns the event's poll event as an instance of mint::poll_event_t. |
const |
isPeriodic | Returns true if the timer is periodic; otherwise returns false. |
const |
isRunning | Returns true if the timer is running; otherwise returns false. |
const |
new | Creates a new timer. The created timer is not started. The clockType can be a... |
const |
reset | Reset the internal event state |
const |
restart | Restarts the timer with the same timeout delay than the previous call to Syst... |
const |
start | Starts or restarts a timer that will timeout after a delay of delay milliseco... |
const |
stop | Stops the timer. |
const |
wait | Waits until the timer timeout. If timeout is given, the wait stop after timeout... |
| Modifiers | Member | Description |
|---|---|---|
const |
clone | Disable object copy. |
final |
d_ptr | Object data. |
final |
delay | Internal timer delay. |
@ const
|
g_lib | Global library handle. |
final |
period | Internal timer period. |
0
def (self)
Resets the timeout event.
none
Disable object copy.
null
Object data.
none
Internal timer delay.
lib ('libmint-system')
Global library handle.
def (const self)
Returns the timer delay in milliseconds as a number.
def (const self)
Returns the handle used by System.Poller.
def (const self)
Returns the timer period in milliseconds as a number.
def (const self)
Returns the event's poll event as an instance of mint::poll_event_t.
def (const self)
Returns true if the timer is periodic; otherwise returns false.
def (const self)
Returns true if the timer is running; otherwise returns false.
def (self, clockType = System.Timer.ClockType.Monotonic)
Creates a new timer. The created timer is not started.
The clockType can be a value of System.Timer.ClockType that
describe the timer's clock precision.
If no timer can be created, none is returned.
none
Internal timer period.
def (self)
Reset the internal event state
def (self)
Restarts the timer with the same timeout delay than the previous call to start. The timeout event is reset.
Returns true if a previous timeout delay can be found; otherwise
false is returned and the timer is not started.
def (self, delay)
Starts or restarts a timer that will timeout after a delay of delay milliseconds.
def (self, delay, period)
Starts or restarts a timer that will timeout after a delay of delay milliseconds then every period
milliseconds.
def (self)
Stops the timer.
def (self, timeout = none)
Waits until the timer timeout. If timeout is given, the wait
stop after timeout milliseconds if the timer has still not timed
out.
Returns true if the timer timed out; otherwise returns false if
the wait timed out.
After a call to this method, the event is reset.
- Introduction
- Variables
-
Built-in-types
- Built-in-types#none
- Built-in-types#null
- Built-in-types#boolean
- Built-in-types#number
- Built-in-types#string
- Built-in-types#regex
- Built-in-types#array
- Built-in-types#hash
- Built-in-types#iterator
- Built-in-types#async_iterator
- Built-in-types#package
- Built-in-types#function
- Built-in-types#coroutine
- Built-in-types#library
- Built-in-types#libobject
- Arithmetic-operations
- Type-casting
- Control-structures
- Function-definition
- User-defined-types
- Work-with-modules