mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 09:18:00 +08:00
libs/libc/time: add gethrtime() support
Change-Id: I8882207d3a7e5062f70c7b4b95205361c71f8744 Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user