ggCurTime(3)

NAME
ggCurTime, ggUSleep, ggUSlumber : Portable Time Routines

SYNOPSIS
#include <ggi/gg.h>
int ggCurTime(struct timeval *tv);
int ggUSleep(sint32 usecs);
void ggUSlumber(sint32 usecs);

DESCRIPTION
ggCurTime fills the timeval structure pointed to by tv with the current time to the best precision available on the executing platform. ggUSleep sleeps for at least usecs microseconds, to the best precision available on the executing platform, but may be woken up by a signal or other unspecified condition. It is not guaranteed that ggUSleep will wake up prematurely for any specific reason. It is mainly useful for points where the main objective is to avoid using CPU resources, not to perform accurate timing. ggUSlumber does the same thing as ggUSleep, but is guaranteed not to return until the allotted time has elapsed. It is slightly less efficient than ggUSleep with reguard to CPU utilization. All times represent wall-clock (real, versus processor) times. The above routines are often simple macros rather than functions, and as such should not be used by reference. The above functions are threadsafe, but are not guaranteed to be safe to use in a thread that may be cancelled during their execution. They are also not guaranteed to be safe to use in special contexts such as LibGG task handlers, signal handlers and asyncronous procedure calls.

RETURN VALUE
ggCurTime returns 0 on success, or an gg-error(3) code on failure. ggUSleep returns 0 when the alloted time interval has elapsed, or a non-zero value if the sleep was interrupted.