diff options
Diffstat (limited to 'extras/mini-os/include/time.h')
-rw-r--r-- | extras/mini-os/include/time.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/extras/mini-os/include/time.h b/extras/mini-os/include/time.h index 40b4c212fa..067b8b36a1 100644 --- a/extras/mini-os/include/time.h +++ b/extras/mini-os/include/time.h @@ -28,7 +28,7 @@ * of real time into system time */ typedef s64 s_time_t; -#define NOW() ((s_time_t)get_s_time()) +#define NOW() ((s_time_t)monotonic_clock()) #define SECONDS(_s) (((s_time_t)(_s)) * 1000000000UL ) #define TENTHS(_ts) (((s_time_t)(_ts)) * 100000000UL ) #define HUNDREDTHS(_hs) (((s_time_t)(_hs)) * 10000000UL ) @@ -36,7 +36,8 @@ typedef s64 s_time_t; #define MICROSECS(_us) (((s_time_t)(_us)) * 1000UL ) #define Time_Max ((s_time_t) 0x7fffffffffffffffLL) #define FOREVER Time_Max - +#define NSEC_TO_USEC(_nsec) (_nsec / 1000UL) +#define NSEC_TO_SEC(_nsec) (_nsec / 1000000000ULL) /* wall clock time */ typedef long time_t; @@ -46,6 +47,11 @@ struct timeval { suseconds_t tv_usec; /* microseconds */ }; +struct timespec { + time_t ts_sec; + long ts_nsec; +}; + /* prototypes */ void init_time(void); |