Blame docs/reference/glib/html/glib-Timers.html

Packit ae235b
Packit ae235b
<html>
Packit ae235b
<head>
Packit ae235b
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
Packit ae235b
<title>Timers: GLib Reference Manual</title>
Packit ae235b
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
Packit ae235b
<link rel="home" href="index.html" title="GLib Reference Manual">
Packit ae235b
<link rel="up" href="glib-utilities.html" title="GLib Utilities">
Packit ae235b
<link rel="prev" href="glib-Lexical-Scanner.html" title="Lexical Scanner">
Packit ae235b
<link rel="next" href="glib-Spawning-Processes.html" title="Spawning Processes">
Packit ae235b
<meta name="generator" content="GTK-Doc V1.27 (XML mode)">
Packit ae235b
<link rel="stylesheet" href="style.css" type="text/css">
Packit ae235b
</head>
Packit ae235b
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
Packit ae235b
Packit ae235b
Packit ae235b
Top  | 
Packit ae235b
                  Description
Packit ae235b
Packit ae235b
Home
Packit ae235b
Up
Packit ae235b
Prev
Packit ae235b
Next
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Timers

Packit ae235b

Timers — keep track of elapsed time

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Functions

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
GTimer *
Packit ae235b
Packit ae235b
Packit ae235b
g_timer_new ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
void
Packit ae235b
Packit ae235b
Packit ae235b
g_timer_start ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
void
Packit ae235b
Packit ae235b
Packit ae235b
g_timer_stop ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
void
Packit ae235b
Packit ae235b
Packit ae235b
g_timer_continue ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
gdouble
Packit ae235b
Packit ae235b
Packit ae235b
g_timer_elapsed ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
void
Packit ae235b
Packit ae235b
Packit ae235b
g_timer_reset ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
void
Packit ae235b
Packit ae235b
Packit ae235b
g_timer_destroy ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Types and Values

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
 
Packit ae235b
GTimer
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Includes

Packit ae235b
#include <glib.h>
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Description

Packit ae235b

GTimer records a start time, and counts microseconds elapsed since

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

Packit ae235b
Packit ae235b
Packit ae235b

Functions

Packit ae235b
Packit ae235b

g_timer_new ()

Packit ae235b
GTimer *
Packit ae235b
g_timer_new (void);
Packit ae235b

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

Packit ae235b
implicitly called for you).

Packit ae235b
Packit ae235b

Returns

Packit ae235b

a new GTimer.

Packit ae235b
Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

g_timer_start ()

Packit ae235b
void
Packit ae235b
g_timer_start (GTimer *timer);
Packit ae235b

Marks a start time, so that future calls to g_timer_elapsed() will

Packit ae235b
report the time since g_timer_start() was called. g_timer_new()
Packit ae235b
automatically marks the start time, so no need to call
Packit ae235b
g_timer_start() immediately after creating the timer.

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

timer

Packit ae235b

a GTimer.

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

g_timer_stop ()

Packit ae235b
void
Packit ae235b
g_timer_stop (GTimer *timer);
Packit ae235b

Marks an end time, so calls to g_timer_elapsed() will return the

Packit ae235b
difference between this end time and the start time.

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

timer

Packit ae235b

a GTimer.

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

g_timer_continue ()

Packit ae235b
void
Packit ae235b
g_timer_continue (GTimer *timer);
Packit ae235b

Resumes a timer that has previously been stopped with

Packit ae235b
g_timer_stop(). g_timer_stop() must be called before using this
Packit ae235b
function.

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

timer

Packit ae235b

a GTimer.

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Since: 2.4

Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

g_timer_elapsed ()

Packit ae235b
gdouble
Packit ae235b
g_timer_elapsed (GTimer *timer,
Packit ae235b
                 gulong *microseconds);
Packit ae235b

If timer

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

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

timer

Packit ae235b

a GTimer.

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

microseconds

Packit ae235b

return location for the fractional part of seconds

Packit ae235b
elapsed, in microseconds (that is, the total number
Packit ae235b
of microseconds elapsed, modulo 1000000), or NULL

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Returns

Packit ae235b

seconds elapsed as a floating point value, including any

Packit ae235b
fractional part.

Packit ae235b
Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

g_timer_reset ()

Packit ae235b
void
Packit ae235b
g_timer_reset (GTimer *timer);
Packit ae235b

This function is useless; it's fine to call g_timer_start() on an

Packit ae235b
already-started timer to reset the start time, so g_timer_reset()
Packit ae235b
serves no purpose.

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

timer

Packit ae235b

a GTimer.

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

g_timer_destroy ()

Packit ae235b
void
Packit ae235b
g_timer_destroy (GTimer *timer);
Packit ae235b

Destroys a timer, freeing associated resources.

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

timer

Packit ae235b

a GTimer to destroy.

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Types and Values

Packit ae235b
Packit ae235b

GTimer

Packit ae235b
typedef struct _GTimer GTimer;
Packit ae235b

Opaque datatype that records a start time.

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Generated by GTK-Doc V1.27
Packit ae235b
</body>
Packit ae235b
</html>