Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
util.h
Go to the documentation of this file.
1#ifndef MIE_ATE_UTIL_H_
2#define MIE_ATE_UTIL_H_
3
4#ifdef _WIN32
5
6#include <time.h>
7
8static inline double GetCurrTime()
9{
10 return clock() / double(CLOCKS_PER_SEC);
11}
12#else
13
14#include <sys/time.h>
15#include <stdio.h>
16
17static inline double GetCurrTime()
18{
19 struct timeval tv;
20 gettimeofday(&tv, NULL);
21 return tv.tv_sec + (double) tv.tv_usec * 1e-6;
22}
23#endif
24
25#endif