freebsd: add uv_hrtime().

This commit is contained in:
Ben Noordhuis 2011-07-11 03:00:18 +02:00
parent cef595eedc
commit 1a0e452de1

View File

@ -21,9 +21,21 @@
#include "uv.h"
#include <string.h>
#include <time.h>
#include <sys/types.h>
#include <sys/sysctl.h>
#undef NANOSEC
#define NANOSEC 1000000000
uint64_t uv_hrtime(void) {
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return (ts.tv_sec * NANOSEC + ts.tv_nsec);
}
int uv_exepath(char* buffer, size_t* size) {
uint32_t usize;
int result;