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);
42 ASSERTMSG_(m_freq.QuadPart != 0,
"Error getting QueryPerformanceFrequency()");
43 dbl_period = 1.0 /
static_cast<double>(m_freq.QuadPart);
52 #ifdef MRPT_OS_WINDOWS 53 # define LARGE_INTEGER_NUMS reinterpret_cast<LARGE_INTEGER*>(largeInts) 55 # define TIMEVAL_NUMS reinterpret_cast<struct timeval*>(largeInts) 65 #ifdef MRPT_OS_WINDOWS 66 static_assert(
sizeof(
largeInts ) >= 2*
sizeof(LARGE_INTEGER),
"sizeof(LARGE_INTEGER) failed!");
68 static_assert(
sizeof(
largeInts ) > 2*
sizeof(
struct timeval),
"sizeof(struct timeval) failed!");
79 #ifdef MRPT_OS_WINDOWS 80 LARGE_INTEGER *l= LARGE_INTEGER_NUMS;
81 QueryPerformanceCounter(&l[0]);
84 gettimeofday( &ts[0], NULL);
94 #ifdef MRPT_OS_WINDOWS 95 LARGE_INTEGER *l= LARGE_INTEGER_NUMS;
96 QueryPerformanceCounter( &l[1] );
97 return (l[1].QuadPart-l[0].QuadPart) * AuxWindowsTicTac::GetInstance().dbl_period;
100 gettimeofday( &ts[1], NULL);
101 return ( ts[1].tv_sec - ts[0].tv_sec) + 1e-6*( ts[1].tv_usec - ts[0].tv_usec );
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
unsigned long long largeInts[8]
void Tic()
Starts the stopwatch.
GLsizei GLsizei GLuint * obj
CTicTac()
Default constructor. Implicitly calls Tic()
double Tac()
Stops the stopwatch.
#define ASSERTMSG_(f, __ERROR_MSG)