Create  Edit  FrontPage  Index  Search  Changes  History  RSS  Back  Login

GLib::Timeout Diff - Ruby-GNOME2 Project Website

  • Added parts are displayed like this.
  • Deleted parts are displayed like this.

= module GLib::Timeout

== Module Functions

--- GLib::Timeout.add(interval){ ... }

    Sets a block to be called at regular intervals, with the default priority, GLib::PRIORITY_DEFAULT. The block is called repeatedly until it returns false, at which point the timeout is automatically destroyed and the block will not be called again. The first call to the block will be at the end of the first interval.
    Note that timeout blocks may be delayed, due to the processing of other event sources. Thus they should not be relied on for precise timing. After each call to the timeout block, the time of the next timeout is recalculated based on the current time and the given interval (it does not try to 'catch up' time lost in delays).
    If you want to have a timer in the "seconds" range and do not care about the exact time of the first call of the timer, use the g_timeout_add_seconds() function; this function allows for more optimizations and more efficient system power usage.
    * interval: the time between calls to the block, in milliseconds (1/1000ths of a second)  
    * { ... }: A block to call  
    * Returns: self

--- GLib::Timeout.add_secondsGLib::Timeout.add_seconds(interval){ ... }

         Sets a block to be called at regular intervals, with the default priority, GLib::PRIORITY_DEFAULT. The block is called repeatedly until it returns false, at which point the timeout is automatically destroyed and the block will not be called again.
    Unlike GLib::Timeout.add, this function operates at whole second granularity. The initial starting point of the timer is determined by the implementation and the implementation is expected to group multiple timers together so that they fire all at the same time. To allow this grouping, the interval to the first timer is rounded and can deviate up to one second from the specified interval. Subsequent timer iterations will generally run at the specified interval.
    Note that timeout functions may be delayed, due to the processing of other event sources. Thus they should not be relied on for precise timing. After each call to the timeout function, the time of the next timeout is recalculated based on the current time and the given interval.
    If you want timing more precise than whole seconds, use GLib::Timeout.add instead.
    The grouping of timers to fire at the same time results in a more power and CPU efficient behavior so if your timer is in multiples of seconds and you don't require the first timer exactly one second from now, the use of this method is preferred over GLib::Timeout.add. ((*Since 2.14*))
    
* interval: the time between calls to the block, in seconds
    * { ... }: A block to call  
    *
Returns: self: ((*FIXME*))self

--- GLib::Timeout.source_new

     * Returns: self: ((*FIXME*))

--- GLib::Timeout.source_new_seconds

     * Returns: self: ((*FIXME*))

== See Also

== ChangeLog

  * 2009-01-29: vinc-mai: add.vincent: add, add_seconds.