libs/libc/time: add gethrtime() support

Change-Id: I8882207d3a7e5062f70c7b4b95205361c71f8744
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd
2020-07-27 20:41:54 +08:00
committed by Matias N
parent b3541ccaf8
commit c38c821fc2
3 changed files with 73 additions and 0 deletions
+16
View File
@@ -44,6 +44,7 @@
#include <time.h>
#include <sys/select.h>
#include <sys/types.h>
/****************************************************************************
* Pre-processor Definitions
@@ -138,6 +139,8 @@
* Public Type Definitions
****************************************************************************/
typedef clock_t hrtime_t;
/* struct timeval represents time as seconds plus microseconds */
struct timeval
@@ -383,6 +386,19 @@ int setitimer(int which, FAR const struct itimerval *value,
int utimes(FAR const char *path, const struct timeval times[2]);
/****************************************************************************
* Name: gethrtime
*
* Description:
* Get the current time
*
* Returned Value:
* The current value of the system time in ns
*
****************************************************************************/
hrtime_t gethrtime(void);
#undef EXTERN
#if defined(__cplusplus)
}