(C) 1998 AROS - The Amiga Research OS


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

int gettimeofday ()

SYNOPSIS
struct timeval * tv
struct timezone * tz

FUNCTION
Return the current time and/or timezone.

INPUTS
tv
If this pointer is non-NULL, the current time will be stored here. The structure looks like this:

struct timeval { long tv_sec; // seconds long tv_usec; // microseconds };

tz
If this pointer is non-NULL, the current timezone will be stored here. The structure looks like this:

struct timezone { int tz_minuteswest; // minutes west of Greenwich int tz_dsttime; // type of dst correction };

With daylight savings times defined as follows :

DST_NONE // not on dst DST_USA // USA style dst DST_AUST // Australian style dst DST_WET // Western European dst DST_MET // Middle European dst DST_EET // Eastern European dst DST_CAN // Canada DST_GB // Great Britain and Eire DST_RUM // Rumania DST_TUR // Turkey DST_AUSTALT // Australian style with shift in 1986

And the following macros are defined to operate on this :

timerisset(tv) - TRUE if tv contains a time

timercmp(tv1, tv2, cmp) - Return the result of the comparison "tv1 cmp tv2"

timerclear(tv) - Clear the timeval struct

RESULT
The number of seconds.

EXAMPLE
struct timeval tv;

// Get the current time and print it
gettimeofday (&tv, NULL);

printf ("Seconds = %ld, uSec = %ld\n", tv->tv_sec, tv->tv_usec);
SEE ALSO
ctime(), asctime(), localtime(), time()

NOTES

BUGS

INTERNALS

HISTORY
25.01.1999 srittau
TODO -> FIXME
20.10.1998 hkiel
Amiga Research OS
12.09.1998 hkiel
converted TODO/FIXME comments to #warnings
20.05.1997 aros
Added a couple of floating point math functions from fdlibm by Sun.