function G_Alarm(callback, delayMS, opt_repeating, opt_maxTimes) {
  this.debugZone = "alarm";
  this.callback_ = callback;
  this.repeating_ = !!opt_repeating;
  this.timer_ = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
  var type = opt_repeating ? 
             this.timer_.TYPE_REPEATING_SLACK : 
             this.timer_.TYPE_ONE_SHOT;
  this.maxTimes_ = opt_maxTimes ? opt_maxTimes : null;
  this.nTimes_ = 0;

  this.observerServiceObserver_ = new G_ObserverServiceObserver(
                                        'xpcom-shutdown',
                                        BindToObject(this.cancel, this));

  // Ask the timer to use nsITimerCallback (.notify()) when ready
  this.timer_.initWithCallback(this, delayMS, type);
}
/**
 * Set an alarm to fire after a given amount of time, or at specific 
 * intervals.
 *
 * @param callback Function to call when the alarm fires
 * @param delayMS Number indicating the length of the alarm period in ms
 * @param opt_repeating Boolean indicating whether this should fire 
 *                      periodically
 * @param opt_maxTimes Number indicating a maximum number of times to 
 *                     repeat (obviously only useful when opt_repeating==true)
 */
Set an alarm to fire after a given amount of time, or at specific
intervals.

@param callback Function to call when the alarm fires
@param delayMS Number indicating the length of the alarm period in ms
@param opt_repeating Boolean indicating whether this should fire
periodically
@param opt_maxTimes Number indicating a maximum number of times to
repeat (obviously only useful when opt_repeating==true)
Set an alarm to fire after a given amount of time or at specific intervals . @param callback Function to call when the alarm fires @param delayMS Number indicating the length of the alarm period in ms @param opt_repeating Boolean indicating whether this should fire periodically @param opt_maxTimes Number indicating a maximum number of times to repeat ( obviously only useful when opt_repeating == true )
function G_Alarm(callback, delayMS, opt_repeating, opt_maxTimes) {
  this.debugZone = "alarm";
  this.callback_ = callback;
  this.repeating_ = !!opt_repeating;
  this.timer_ = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
  var type = opt_repeating ? 
             this.timer_.TYPE_REPEATING_SLACK : 
             this.timer_.TYPE_ONE_SHOT;
  this.maxTimes_ = opt_maxTimes ? opt_maxTimes : null;
  this.nTimes_ = 0;
  this.observerServiceObserver_ = new G_ObserverServiceObserver(
                                        'xpcom-shutdown',
                                        BindToObject(this.cancel, this));
  this.timer_.initWithCallback(this, delayMS, type);
}
function G_Alarm ( callback , delayMS , opt_repeating , opt_maxTimes ) { this . debugZone = "alarm" ; this . callback_ = callback ; this . repeating_ = ! ! opt_repeating ; this . timer_ = Cc [ "@mozilla.org/timer;1" ] . createInstance ( Ci . nsITimer ) ; var type = opt_repeating ? this . timer_ . TYPE_REPEATING_SLACK : this . timer_ . TYPE_ONE_SHOT ; this . maxTimes_ = opt_maxTimes ? opt_maxTimes : null ; this . nTimes_ = 0 ; this . observerServiceObserver_ = new G_ObserverServiceObserver ( 'xpcom-shutdown' , BindToObject ( this . cancel , this ) ) ; this . timer_ . initWithCallback ( this , delayMS , type ) ; }
Set an alarm to fire after a given amount of time, or at specific
 intervals.
Set an alarm to fire after a given amount of time or at specific intervals .
// Ask the timer to use nsITimerCallback (.notify()) when ready