Main Page | Class List | File List | Class Members | File Members | Related Pages

gi_time.h File Reference

Portable and convenient timing routines. More...

#include <time.h>
#include <sys/time.h>

Go to the source code of this file.

Classes

struct  GiStopWatch

Functions

LIBGIFT_EXPORT void gi_stopwatch_init (GiStopWatch *watch)
LIBGIFT_EXPORT bool gi_stopwatch_start (GiStopWatch *watch)
LIBGIFT_EXPORT bool gi_stopwatch_stop (GiStopWatch *watch)
LIBGIFT_EXPORT void gi_stopwatch_reset (GiStopWatch *watch)
LIBGIFT_EXPORT double gi_stopwatch_elapsed (GiStopWatch *watch)
LIBGIFT_EXPORT int gettimeofday (struct timeval *tv, struct timezone *tz)


Detailed Description

Portable and convenient timing routines.

This module provides both a portable gettimeofday() and a GiTimer API similar to GLib's "stopwatch".


Function Documentation

LIBGIFT_EXPORT int gettimeofday struct timeval *  tv,
struct timezone *  tz
 

Emulate BSD 4.3 gettimeofday(). The `tz' parameter is not used by this implementation, and it will be considered an error to specify anything but NULL.

LIBGIFT_EXPORT double gi_stopwatch_elapsed GiStopWatch watch  ) 
 

Calculate (or simply access) the total time elapsed while this timer was active. This does not represent the time elapsed between the last start and stop, rather the total time elapsed between each start/stop call.

Returns:
The time elapsed is returned in seconds, with double-precision.

LIBGIFT_EXPORT void gi_stopwatch_init GiStopWatch watch  ) 
 

Initialize the stopwatch. This step is required before any timing operatings may be reliably performed.

LIBGIFT_EXPORT void gi_stopwatch_reset GiStopWatch watch  ) 
 

Reset the timer as though it was just initialized.

LIBGIFT_EXPORT bool gi_stopwatch_start GiStopWatch watch  ) 
 

Begin the timer such that the time elapsed between the current time (as of this call) and the stop-point will be added to the total elapsed time.

LIBGIFT_EXPORT bool gi_stopwatch_stop GiStopWatch watch  ) 
 

Stop timing and update the total time elapsed while this timer was active.


Generated on Sun Aug 22 07:56:41 2004 by doxygen 1.3.7