2014-07-25 03:25:17 +00:00
|
|
|
|
|
|
|
#ifndef __SYS_KTIME_H__
|
|
|
|
#define __SYS_KTIME_H__
|
|
|
|
|
|
|
|
uint64_t Time_GetTSC();
|
|
|
|
|
2014-11-25 00:17:17 +00:00
|
|
|
typedef struct KTime {
|
|
|
|
int sec;
|
|
|
|
int min;
|
|
|
|
int hour;
|
|
|
|
int month;
|
|
|
|
int year;
|
|
|
|
int mday;
|
|
|
|
int wday;
|
|
|
|
int yday;
|
|
|
|
} KTime;
|
|
|
|
|
2014-11-25 06:21:37 +00:00
|
|
|
typedef uint64_t UnixEpoch;
|
|
|
|
typedef uint64_t UnixEpochNS;
|
|
|
|
|
2014-11-25 00:17:17 +00:00
|
|
|
void KTime_Fixup(KTime *tm);
|
2014-11-25 06:21:37 +00:00
|
|
|
UnixEpoch KTime_ToEpoch(const KTime *tm);
|
|
|
|
void KTime_FromEpoch(UnixEpoch time, KTime *tm);
|
2015-01-16 22:32:47 +00:00
|
|
|
void KTime_SetTime(UnixEpoch epoch, uint64_t tsc, uint64_t tps);
|
2014-11-25 00:17:17 +00:00
|
|
|
void KTime_Tick(int rate);
|
2014-11-25 06:21:37 +00:00
|
|
|
UnixEpoch KTime_GetEpoch();
|
|
|
|
UnixEpochNS KTime_GetEpochNS();
|
2014-11-25 00:17:17 +00:00
|
|
|
|
2014-07-25 03:25:17 +00:00
|
|
|
#endif /* __SYS_KTIME_H__ */
|
|
|
|
|