Timer

class Timer(pointer: <Error class: unknown class><<Error class: unknown class>>) : ProxyInstance

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

  • function new: Return type Timer is unsupported

Constructors

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

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
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
open override fun hashCode(): Int
Link copied to clipboard

Exposes whether the timer is currently active.

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.