Timer

class Timer(val glibTimerPointer: <Error class: unknown class><<Error class: unknown class>>) : ProxyInstance(source)

GTimer records a start time, and counts microseconds elapsed since that time.

This is done somewhat differently on different platforms, and can be tricky to get exactly right, so GTimer provides a portable/convenient interface.

Skipped during bindings generation

  • parameter microseconds: Unsupported pointer to primitive type

Constructors

Link copied to clipboard
constructor(glibTimerPointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val glibTimerPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val handle: <Error class: unknown class>

Functions

Link copied to clipboard
open override fun addCleaner(cleaner: <Error class: unknown class>): Boolean

Registers a cleaner to be executed when this proxy object is garbage collected.

Link copied to clipboard
fun continue()

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

Link copied to clipboard
fun destroy()

Destroys a timer, freeing associated resources.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Compare two proxy instances for equality. This will compare both the type of the instances, and their memory addresses.

Link copied to clipboard
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Exposes whether the timer is currently active.

Link copied to clipboard
open override fun removeCleaner(cleaner: <Error class: unknown class>): Boolean

Removes a previously registered cleaner from this proxy object.

Link copied to clipboard
fun reset()

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

Link copied to clipboard
fun start()

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

Link copied to clipboard
fun stop()

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