Readonly
allowedThe number of microseconds this nsITimer implementation can possibly fire early.
Readonly
callbackThe nsITimerCallback object passed to initWithCallback.
Readonly
closureThe opaque pointer pass to initWithFuncCallback.
The millisecond delay of the timeout.
NOTE: Re-setting the delay on a one-shot timer that has already fired doesn't restart the timer. Call one of the init() methods to restart a one-shot timer.
The nsIEventTarget where the callback will be dispatched. Note that this target may only be set before the call to one of the init methods above.
By default the target is the thread that created the timer.
The timer type - one of the above TYPE_* constants.
Optional
aInstancePtr: objectA run time mechanism for interface discovery.
NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.
aInstancePtr must not be null.
[in] A requested interface IID
[out] A pointer to an interface pointer to receive the result.
Initialize a timer that will fire after the said delay. A user must keep a reference to this timer till it is is no longer needed or has been cancelled.
the callback object that observes the ``timer-callback'' topic with the subject being the timer itself when the timer fires:
observe(nsISupports aSubject, => nsITimer string aTopic, => ``timer-callback'' wstring data => null
delay in milliseconds for timer to fire
timer type per TYPE* consts defined above
Initialize a timer to fire after the high resolution TimeDuration. This version takes a callback object.
The high resolution interval
Timer type per TYPE* consts defined above
Initialize a timer to fire after the high resolution TimeDuration. This version takes a named function callback.
An opaque pointer to pass to that function
The high resolution interval
Timer type per TYPE* consts defined above
The timer's name
Initialize a timer to fire after the given millisecond interval. This version takes a callback object.
The millisecond interval
Timer type per TYPE* consts defined above
Like initWithFuncCallback, but also takes a name for the timer; the name will be used when timer profiling is enabled via the "TimerFirings" log module.
An opaque pointer to pass to that function
The millisecond interval
Timer type per TYPE* consts defined above
The timer's name
Generated using TypeDoc
nsITimer instances must be initialized by calling one of the "init" methods documented below. You may also re-initialize (using one of the init() methods) an existing instance to avoid the overhead of destroying and creating a timer. It is not necessary to cancel the timer in that case.
By default a timer will fire on the thread that created it. Set the .target attribute to fire on a different thread. Once you have set a timer's .target and called one of its init functions, any further interactions with the timer (calling cancel(), changing member fields, etc) should only be done by the target thread, or races may occur with bad results like timers firing after they've been canceled, and/or not firing after re-initiatization.