📄 time.h
字号:
/**************************************************************************
** *
** FILE : time.h *
** *
** DESCRIPTION : Include file with prototypes and macros for *
** manipulating time. *
** The low level time routine _time() strongly depends *
** on the hardware , so this routine should be customised.*
** To determine the time in seconds, the value returned *
** by the _time() function should be divided by the value *
** of the macro TICKS_PER_SEC. *
** *
** COPYRIGHT : 1997 Tasking Software B.V., Amersfoort *
** *
**************************************************************************/
#ifndef _timeh
#define _timeh
#include <stddef.h>
#if ! defined(FARDATA)
#if _FAR_DATA_ || _FAR_CONST_
#define FARDATA far
#else
#define FARDATA
#endif
#endif
#pragma varparams(asctime, ctime, difftime, gmtime, localtime, time)
#pragma varparams(mktime, clock, strftime, _stime, _tzset, _time)
typedef unsigned long time_t;
typedef unsigned long clock_t;
#define TIME_MAX (time_t)(-1)
#define TIME_MIN (time_t)(0)
/* starting point for calendar times
* time is measured in seconds since
* 1 January 1970
*/
#define _BIAS_TIME ((70 * 365LU + 17) * 86400)
#define TICKS_PER_SEC 1000 /* _time() result is in mseconds */
#define CLOCKS_PER_SEC TICKS_PER_SEC
struct tm
{
int tm_sec; /* seconds after the minute - [0, 59] */
int tm_min; /* minutes after the hour - [0, 59 ] */
int tm_hour; /* hours since midnight - [0, 23] */
int tm_mday; /* day of the month - [1, 31] */
int tm_mon; /* months since January - [0, 11] */
int tm_year; /* year since 1900 */
int tm_wday; /* days since Sunday - [0, 6] */
int tm_yday; /* days since January 1 - [0, 365] */
int tm_isdst; /* Daylight Saving TIme flag */
};
char *asctime(const FARDATA struct tm *);
char *ctime(const FARDATA time_t *);
double difftime(time_t, time_t);
struct tm *gmtime(const FARDATA time_t *);
struct tm *localtime(const FARDATA time_t *);
time_t time(time_t *);
time_t mktime(struct tm *);
clock_t clock(void);
size_t strftime(char *, size_t, const FARDATA char *, const FARDATA struct tm *);
void _stime(time_t *); /* sets system time */
int _tzset(const FARDATA char *); /* sets time zone */
time_t _time(time_t *); /* low level time function */
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -