mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
40 lines
957 B
C
40 lines
957 B
C
#ifdef _WIN32
|
|
#define WIN32_LEAN_AND_MEAN
|
|
#include <Windows.h>
|
|
#include <Winsock2.h>
|
|
#include <stdint.h>
|
|
#include < time.h >
|
|
#include "darknet.h"
|
|
|
|
#define CLOCK_REALTIME (1)
|
|
#define BILLION (1E9)
|
|
|
|
#ifndef timersub
|
|
#define timersub(a, b, result) \
|
|
do { \
|
|
(result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
|
|
(result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
|
|
if ((result)->tv_usec < 0) { \
|
|
--(result)->tv_sec; \
|
|
(result)->tv_usec += 1000000; \
|
|
} \
|
|
} while (0)
|
|
#endif // timersub
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
static unsigned char g_first_time = 1;
|
|
static LARGE_INTEGER g_counts_per_sec;
|
|
|
|
LIB_API int gettimeofday(struct timeval*, struct timezone*);
|
|
LIB_API int clock_gettime(int, struct timespec*);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|
|
|