11.2 OTcl Timer class

A simple timer class is defined in ~ns/tcl/mcast/timer.tcl. Subclasses of Timer can be defined as needed. Unlike the C++ timer API, where a []sched aborts if the timer is already set, []sched and []resched are the same; i.e., no state is kept for the OTcl timers. The following methods are defined in the Timer base class:

    $self sched $delay   # causes "$self timeout" to be called $delay seconds in the future;
    $self resched $delay # same as "$self sched $delay" ;
    $self cancel         # cancels any pending scheduled callback;
    $self destroy        # same as "$self cancel";
    $self expire         # calls "$self timeout" immediately;

Tom Henderson 2011-11-05