Move around uv_hrtime in the header
This commit is contained in:
parent
7b56134f73
commit
fa514948fc
@ -23,6 +23,16 @@
|
||||
#include "task.h"
|
||||
|
||||
|
||||
#ifndef MICROSEC
|
||||
# define MICROSEC 1000000
|
||||
#endif
|
||||
|
||||
#ifndef NANOSEC
|
||||
# define NANOSEC 1000000000
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* We expect the amount of time passed to be at least one us plus two system
|
||||
* calls. Therefore checking that at least a microsecond has elapsed is safe.
|
||||
|
||||
41
uv.h
41
uv.h
@ -459,6 +459,18 @@ struct sockaddr_in6 uv_ip6_addr(const char* ip, int port);
|
||||
/* Gets the executable path */
|
||||
int uv_exepath(char* buffer, size_t* size);
|
||||
|
||||
/*
|
||||
* Returns the current high-resolution real time. This is expressed in
|
||||
* nanoseconds. It is relative to an arbitrary time in the past. It is not
|
||||
* related to the time of day and therefore not subject to clock drift. The
|
||||
* primary use is for measuring performance between intervals.
|
||||
*
|
||||
* Note not every platform can support nanosecond resolution; however, this
|
||||
* value will always be in nanoseconds.
|
||||
*/
|
||||
extern uint64_t uv_hrtime(void);
|
||||
|
||||
|
||||
/* the presence of this union forces similar struct layout */
|
||||
union uv_any_handle {
|
||||
uv_tcp_t tcp;
|
||||
@ -486,35 +498,6 @@ typedef struct {
|
||||
|
||||
uv_counters_t* uv_counters();
|
||||
|
||||
|
||||
#ifndef SEC
|
||||
# define SEC 1
|
||||
#endif
|
||||
|
||||
#ifndef MILLISEC
|
||||
# define MILLISEC 1000
|
||||
#endif
|
||||
|
||||
#ifndef MICROSEC
|
||||
# define MICROSEC 1000000
|
||||
#endif
|
||||
|
||||
#ifndef NANOSEC
|
||||
# define NANOSEC 1000000000
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Returns the current high-resolution real time. This is expressed in
|
||||
* nanoseconds. It is relative to an arbitrary time in the past. It is not
|
||||
* related to the time of day and therefore not subject to clock drift. The
|
||||
* primary use is for measuring performance between intervals.
|
||||
*
|
||||
* Note not every platform can support nanosecond resolution; however, this
|
||||
* value will always be in nanoseconds.
|
||||
*/
|
||||
extern uint64_t uv_hrtime(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user