local timer = require('time').system_timer
local t = timer.new()
A timer for the system_clock. As in Boost.Asio:
A waitable timer is always in one of two states: "expired" or "not expired". If the
async_wait()function is called on an expired timer, the wait operation will complete immediately.Changing an active waitable timer’s expiry time
Changing the expiry time of a timer while there are pending asynchronous waits causes those wait operations to be cancelled.
Forward the call to the function with same name in Boost.Asio:
Set the timer’s expiry time as an absolute time. Any pending asynchronous wait operations will be cancelled. The handler for each cancelled operation will be invoked with the
boost::asio::error::operation_abortederror code.Return Value
The number of asynchronous operations that were cancelled.
Initiate a wait operation on the timer and blocks current fiber until one of the events occur:
The timer has expired.
The timer was cancelled, in which case it raises