2022-10-15 11:21:22 +00:00
|
|
|
#ifndef _TIME_H
|
|
|
|
#define _TIME_H
|
|
|
|
|
2022-10-23 08:01:03 +00:00
|
|
|
#include <stddef.h>
|
2022-10-25 17:27:24 +00:00
|
|
|
#include <sys/types.h>
|
2022-10-23 08:01:03 +00:00
|
|
|
|
2022-10-25 17:27:24 +00:00
|
|
|
// Structure representing broken-down time.
|
2022-10-22 10:17:48 +00:00
|
|
|
struct tm
|
|
|
|
{
|
|
|
|
int tm_sec;
|
|
|
|
int tm_min;
|
|
|
|
int tm_hour;
|
|
|
|
int tm_mday;
|
|
|
|
int tm_mon;
|
|
|
|
int tm_year;
|
|
|
|
int tm_wday;
|
|
|
|
int tm_yday;
|
|
|
|
int tm_isdst;
|
|
|
|
|
|
|
|
long tm_gmtoff;
|
|
|
|
const char* tm_zone;
|
|
|
|
};
|
|
|
|
|
2022-10-25 17:27:24 +00:00
|
|
|
#define CLOCKS_PER_SEC 1000 // Number of clock_t per second.
|
2022-10-15 11:21:22 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Returns a number representing how much CPU time has been used by this process. Divide this by CLOCKS_PER_SEC to
|
|
|
|
* get the value in seconds. */
|
|
|
|
clock_t clock(void);
|
|
|
|
|
2022-10-21 16:32:01 +00:00
|
|
|
/* FIXME: For now, is an alias for clock(), but in seconds. */
|
|
|
|
time_t time(time_t* tloc);
|
|
|
|
|
2022-10-23 08:01:03 +00:00
|
|
|
struct tm* localtime(const time_t* timep); // Not implemented.
|
|
|
|
struct tm* gmtime(const time_t* timep); // Not implemented.
|
|
|
|
size_t strftime(char* str, size_t max, const char* format, const struct tm* time); // Not implemented.
|
2022-10-22 10:17:48 +00:00
|
|
|
|
2022-10-15 11:21:22 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|