up: ZUT     index Zimbu documentation

CLASS ZUT.Timer @public

summary

     

A Timer is used to postpone a callback to be invoked. The Timer fires once. To trigger multiple times use an Interval.

Currently only implemented for Javascript.

NEW(callback, time) @public  Create a new timer that will invoke callback after time milliseconds.
$getTime() int @public  Returns the time this Timer was created with.
$restart() @public  Restart the timer.
$restart(time) @public  Restart the timer with a new delay time milliseconds.
$cancel() @public  Cancel the timer.
$fire() @public  Cancel the timer and invoke the callback right away.
 

members (alphabetically)

     

PROC NEW(proc<> callback, int time) @public

     

Create a new timer that will invoke callback after time milliseconds.

When time is zero the callback will be invoked as soon as the current work is done.

PROC $cancel() @public

     

Cancel the timer.

If the timer already fired or was already cancelled this has no effect.

PROC $fire() @public

     

Cancel the timer and invoke the callback right away.

FUNC $getTime() int @public

     

Returns the time this Timer was created with.

PROC $restart() @public

     

Restart the timer.

If it was pending it is cancelled first.

PROC $restart(int time) @public

     

Restart the timer with a new delay time milliseconds.

If it was pending it is cancelled first.

license

      Copyright 2014 Bram Moolenaar All Rights Reserved.

      Licensed under the Apache License, Version 2.0. See the LICENSE file or obtain a copy at: http://www.apache.org/licenses/LICENSE-2.0