glib.Timer.Timer Class Reference

List of all members.

Detailed Description

Description 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.


Public Member Functions

GTimergetTimerStruct ()
 this (GTimer *gTimer)
 Sets our main struct and passes it to the parent class.
void _Start ()
 Marks a start time, so that future calls to g_timer_elapsed() will report the time since g_timer_start() was called.
void _Stop ()
 Marks an end time, so calls to g_timer_elapsed() will return the difference between this end time and the start time.
void _Continue ()
 Resumes a timer that has previously been stopped with g_timer_stop().
double _Elapsed (uint *microseconds)
 If timer has been started but not stopped, obtains the time since the timer was started.
void _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.
void _Destroy ()
 Destroys a timer, freeing associated resources.

Static Public Member Functions

static Timer _New ()
 Creates a new timer, and starts timing (i.e.

Protected Member Functions

void * getStruct ()
 the main Gtk struct as a void*

Protected Attributes

GTimergTimer
 the main Gtk struct


Constructor & Destructor Documentation

glib.Timer.Timer.this ( GTimer gTimer  ) 

Sets our main struct and passes it to the parent class.


Member Function Documentation

void glib.Timer.Timer._Continue (  ) 

Resumes a timer that has previously been stopped with g_timer_stop().

g_timer_stop() must be called before using this function. timer: a GTimer. Since 2.4

void glib.Timer.Timer._Destroy (  ) 

Destroys a timer, freeing associated resources.

timer: a GTimer to destroy.

double glib.Timer.Timer._Elapsed ( uint microseconds  ) 

If timer has been started but not stopped, obtains the time since the timer was started.

If timer 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. timer: a GTimer. microseconds: return location for the fractional part of seconds elapsed, in microseconds (that is, the total number of microseconds elapsed, modulo 1000000), or NULL Returns: seconds elapsed as a floating point value, including any fractional part.

static Timer glib.Timer.Timer._New (  )  [static]

Creates a new timer, and starts timing (i.e.

g_timer_start() is implicitly called for you). Returns: a new GTimer.

void glib.Timer.Timer._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.

timer: a GTimer.

void glib.Timer.Timer._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. timer: a GTimer.

void glib.Timer.Timer._Stop (  ) 

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

timer: a GTimer.

void* glib.Timer.Timer.getStruct (  )  [protected]

the main Gtk struct as a void*

GTimer* glib.Timer.Timer.getTimerStruct (  ) 


Member Data Documentation

GTimer* glib.Timer.Timer.gTimer [protected]

the main Gtk struct


SourceForge.net Logo DSource.org Logo digitalmars.com Logo