24 #include <type_traits> 43 QueryPerformanceFrequency(&
m_freq);
44 assert(
m_freq.QuadPart != 0);
55 #define LARGE_INTEGER_NUMS reinterpret_cast<LARGE_INTEGER*>(largeInts) 57 #define TIMEVAL_NUMS reinterpret_cast<struct timespec*>(largeInts) 66 sizeof(
largeInts) >= 2 *
sizeof(LARGE_INTEGER),
67 "sizeof(LARGE_INTEGER) failed!");
70 sizeof(
largeInts) >= 2 *
sizeof(
struct timespec),
71 "sizeof(struct timespec) failed!");
80 QueryPerformanceCounter(&l[0]);
82 auto* ts = TIMEVAL_NUMS;
83 clock_gettime(CLOCK_MONOTONIC, &ts[0]);
91 QueryPerformanceCounter(&l[1]);
92 return (l[1].QuadPart - l[0].QuadPart) *
95 auto* ts = TIMEVAL_NUMS;
96 clock_gettime(CLOCK_MONOTONIC, &ts[1]);
97 return static_cast<double>(ts[1].tv_sec - ts[0].tv_sec) +
98 1e-9 * static_cast<double>(ts[1].tv_nsec - ts[0].tv_nsec);
double Tac() noexcept
Stops the stopwatch.
CTicTac() noexcept
Default constructor.
AuxWindowsTicTac() noexcept
static AuxWindowsTicTac & GetInstance() noexcept
void Tic() noexcept
Starts the stopwatch.
#define LARGE_INTEGER_NUMS
unsigned long largeInts[4]