continue_ ()
  destroy ()
  elapsed (microseconds)
  is_active ()
  reset ()
  start ()
  stop ()


class GLib.Timer

Opaque datatype that records a start time.


Resumes a timer that has previously been stopped with GLib.Timer.stop(). GLib.Timer.stop() must be called before using this function.

New in version 2.4.


Destroys a timer, freeing associated resources.

Parameters:microseconds (int) – return location for the fractional part of seconds elapsed, in microseconds (that is, the total number of microseconds elapsed, modulo 1000000), or None
Returns:seconds elapsed as a floating point value, including any fractional part.
Return type:float

If self has been started but not stopped, obtains the time since the timer was started. If self has been stopped, obtains the elapsed time between the time it was started and the time it was stopped. The return value is the number of seconds elapsed, including any fractional part. The microseconds out parameter is essentially useless.

Returns:True if the timer is running, False otherwise
Return type:bool

Exposes whether the timer is currently active.

New in version 2.62.


This function is useless; it’s fine to call GLib.Timer.start() on an already-started timer to reset the start time, so GLib.Timer.reset() serves no purpose.


Marks a start time, so that future calls to GLib.Timer.elapsed() will report the time since GLib.Timer.start() was called. g_timer_new() automatically marks the start time, so no need to call GLib.Timer.start() immediately after creating the timer.


Marks an end time, so calls to GLib.Timer.elapsed() will return the difference between this end time and the start time.