class Timer


Inheritance:


Public Fields

Timer instvar id_
Timer instvar ns_

Public Methods

Timer instproc cancel {}
Timer instproc destroy {}
Timer instproc expire {}
Timer instproc init { ns }
Timer instproc resched delay
Timer instproc sched delay

Documentation

A simple timer class. You can derive a subclass of Timer to provide a simple mechanism for scheduling events:

$self sched $delay -- causes "$self timeout" to be called $delay seconds in the future $self cancel -- cancels any pending scheduled callback

Timer instproc init { ns }

Timer instproc sched delay
sched is the same as resched; the previous setting is cancelled and another event is scheduled. No state is kept for the timers. This is different than the C++ timer API in timer-handler.cc,h; where a sched aborts if the timer is already set. C++ timers maintain state (e.g. IDLE, PENDING..etc) that is checked before the timer is scheduled.

Timer instvar ns_

Timer instvar id_

Timer instproc destroy {}

Timer instproc cancel {}

Timer instproc resched delay
resched and expire are added to have a similar API to C++ timers.

Timer instproc expire {}
the subclass must provide the timeout function


Direct child classes:
Timer/Iface
LogTimer
CacheTimer

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

Adapted for the NS documentation page

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de