added gettime and sleep functions
This commit is contained in:
30
include/tlibc/time.h
Normal file
30
include/tlibc/time.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "std.h"
|
||||
|
||||
/// nanoseconds
|
||||
typedef u64 nsec_t;
|
||||
/// microseconds
|
||||
typedef u64 usec_t;
|
||||
/// miliseconds
|
||||
typedef u64 msec_t;
|
||||
|
||||
/// system time now in nanoseconds
|
||||
///@return u64 will overflow in 13 years
|
||||
nsec_t getTimeNsec();
|
||||
|
||||
/// system time now in microseconds
|
||||
///@return u64 will overflow in 58494 years
|
||||
usec_t getTimeUsec();
|
||||
|
||||
void sleepNsec(nsec_t time);
|
||||
void sleepUsec(usec_t time);
|
||||
void sleepMsec(msec_t time);
|
||||
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user