23 #include <type_traits> 42 QueryPerformanceFrequency(&
m_freq);
43 assert(
m_freq.QuadPart != 0);
54 #define LARGE_INTEGER_NUMS reinterpret_cast<LARGE_INTEGER*>(largeInts) 56 #define TIMEVAL_NUMS reinterpret_cast<struct timeval*>(largeInts) 65 sizeof(
largeInts) >= 2 *
sizeof(LARGE_INTEGER),
66 "sizeof(LARGE_INTEGER) failed!");
69 sizeof(
largeInts) >= 2 *
sizeof(
struct timeval),
70 "sizeof(struct timeval) failed!");
79 QueryPerformanceCounter(&l[0]);
81 auto* ts = TIMEVAL_NUMS;
82 gettimeofday(&ts[0],
nullptr);
90 QueryPerformanceCounter(&l[1]);
91 return (l[1].QuadPart - l[0].QuadPart) *
94 auto* ts = TIMEVAL_NUMS;
95 gettimeofday(&ts[1],
nullptr);
96 return (ts[1].tv_sec - ts[0].tv_sec) +
97 1e-6 * (ts[1].tv_usec - ts[0].tv_usec);
double Tac() noexcept
Stops the stopwatch.
GLsizei GLsizei GLuint * obj
CTicTac() noexcept
Default constructor.
AuxWindowsTicTac() noexcept
static AuxWindowsTicTac & GetInstance() noexcept
void Tic() noexcept
Starts the stopwatch.
#define LARGE_INTEGER_NUMS
unsigned long largeInts[4]