For the latest stable version, please use Emilua API 0.10! |
time.system_timer
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
wait()
orasync_wait()
function is called on an expired timer, the wait operation will complete immediately.Changing an active waitable timer’s expiry timeChanging the expiry time of a timer while there are pending asynchronous waits causes those wait operations to be cancelled.
Functions
expires_at(self, tp: time.system_clock.time_point) → integer
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_aborted
error code.Return ValueThe number of asynchronous operations that were cancelled.