diff options
author | John Ankarstr\xf6m <john@ankarstrom.se> | 2021-05-29 12:54:47 +0200 |
---|---|---|
committer | John Ankarstr\xf6m <john@ankarstrom.se> | 2021-05-29 13:18:40 +0200 |
commit | a041d9898e6d699bd8c0c25482ec574feb03c547 (patch) | |
tree | 7f094e33fb530152c3ab6238ce7300750b47addb /src/timing.h | |
download | jwm-a041d9898e6d699bd8c0c25482ec574feb03c547.tar.gz |
First commit
This is the original state of the released tarball for JWM 1.8,
which will serve as my starting point for further modifications.
Diffstat (limited to 'src/timing.h')
-rw-r--r-- | src/timing.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/timing.h b/src/timing.h new file mode 100644 index 0000000..25a8fca --- /dev/null +++ b/src/timing.h @@ -0,0 +1,43 @@ +/** + * @file timing.h + * @author Joe Wingbermuehle + * @date 2004-2006 + * + * @brief Timing functions. + * + */ + +#ifndef TIMING_H +#define TIMING_H + +#define ZERO_TIME { 0, 0 } + +typedef struct TimeType { + + unsigned long seconds; + int ms; + +} TimeType; + +/** Get the current time. + * @param t The TimeType to fill. + */ +void GetCurrentTime(TimeType *t); + +/** Get the difference between two times. + * Note that the times must be normalized. + * @param t1 The first time. + * @param t2 The second time. + */ +unsigned long GetTimeDifference(const TimeType *t1, const TimeType *t2); + +/** 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. + * @param format The format to use for the string. + * @return The time string. + */ +const char *GetTimeString(const char *format); + +#endif + |