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
Define Documentation
| #define ZERO_TIME { 0, 0 } |
Typedef Documentation
Function Documentation
Get the difference between two times.
Note that the times must be normalized.
- Parameters:
-
t1 The first time. t2 The 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:
-
format The format to use for the string. zone The timezone in tzset() format to use (defaults to local)
- Returns:
- The time string.