JWM Source Documentation

timing.h File Reference

Timing functions. More...

Go to the source code of this file.

Data Structures

struct  TimeType
 Structure to represent time since January 1, 1970 GMT. More...

Defines

#define ZERO_TIME   { 0, 0 }
 Initializer for TimeType to indicate that it is not set.

Typedefs

typedef struct TimeType TimeType
 Structure to represent time since January 1, 1970 GMT.

Functions

void GetCurrentTime (TimeType *t)
 Get the current time.
unsigned long GetTimeDifference (const TimeType *t1, const TimeType *t2)
 Get the difference between two times.
const char * GetTimeString (const char *format, const char *zone)
 Get a time string.

Detailed Description

Timing functions.

Author:
Joe Wingbermuehle
Date:
2004-2006

Definition in file timing.h.


Define Documentation

#define ZERO_TIME   { 0, 0 }

Initializer for TimeType to indicate that it is not set.

Definition at line 14 of file timing.h.


Typedef Documentation

typedef struct TimeType TimeType

Structure to represent time since January 1, 1970 GMT.


Function Documentation

void GetCurrentTime ( TimeType t)

Get the current time.

Parameters:
tThe TimeType to fill.
unsigned long GetTimeDifference ( const TimeType t1,
const TimeType t2 
)

Get the difference between two times.

Note that the times must be normalized.

Parameters:
t1The first time.
t2The second time.
Returns:
The difference in milliseconds (maximum of 60000 ms).
const char* GetTimeString ( const char *  format,
const char *  zone 
)

Get a time string.

Note that the string returned is a static value and should not be deleted. Therefore, this function is not thread safe.

Parameters:
formatThe format to use for the string.
zoneThe timezone in tzset() format to use (defaults to local)
Returns:
The time string.