12 #include <mrpt/config.h> 14 #ifdef MRPT_OS_WINDOWS 25 #ifdef MRPT_OS_WINDOWS 26 struct AuxWindowsTicTac
28 static AuxWindowsTicTac& GetInstance()
30 static AuxWindowsTicTac
obj;
39 AuxWindowsTicTac() : dbl_period(.0)
41 QueryPerformanceFrequency(&m_freq);
43 m_freq.QuadPart != 0,
"Error getting QueryPerformanceFrequency()");
44 dbl_period = 1.0 /
static_cast<double>(m_freq.QuadPart);
53 #ifdef MRPT_OS_WINDOWS 54 #define LARGE_INTEGER_NUMS reinterpret_cast<LARGE_INTEGER*>(largeInts) 56 #define TIMEVAL_NUMS reinterpret_cast<struct timeval*>(largeInts) 66 #ifdef MRPT_OS_WINDOWS 68 sizeof(
largeInts) >= 2 *
sizeof(LARGE_INTEGER),
69 "sizeof(LARGE_INTEGER) failed!");
72 sizeof(
largeInts) > 2 *
sizeof(
struct timeval),
73 "sizeof(struct timeval) failed!");
84 #ifdef MRPT_OS_WINDOWS 85 LARGE_INTEGER* l = LARGE_INTEGER_NUMS;
86 QueryPerformanceCounter(&l[0]);
89 gettimeofday(&ts[0],
nullptr);
99 #ifdef MRPT_OS_WINDOWS 100 LARGE_INTEGER* l = LARGE_INTEGER_NUMS;
101 QueryPerformanceCounter(&l[1]);
102 return (l[1].QuadPart - l[0].QuadPart) *
103 AuxWindowsTicTac::GetInstance().dbl_period;
106 gettimeofday(&ts[1],
nullptr);
107 return (ts[1].tv_sec - ts[0].tv_sec) +
108 1e-6 * (ts[1].tv_usec - ts[0].tv_usec);
unsigned char largeInts[64]
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
void Tic()
Starts the stopwatch.
GLsizei GLsizei GLuint * obj
CTicTac()
Default constructor.
double Tac()
Stops the stopwatch.
#define ASSERTMSG_(f, __ERROR_MSG)