mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 21:36:11 +01:00
parent
fc7f0a02b8
commit
e4694f58da
@ -28,21 +28,21 @@ namespace Catch {
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
#ifdef CATCH_PLATFORM_WINDOWS
|
#ifdef CATCH_PLATFORM_WINDOWS
|
||||||
uint64_t getCurrentTicks() {
|
UInt64 getCurrentTicks() {
|
||||||
static uint64_t hz=0, hzo=0;
|
static UInt64 hz=0, hzo=0;
|
||||||
if (!hz) {
|
if (!hz) {
|
||||||
QueryPerformanceFrequency( reinterpret_cast<LARGE_INTEGER*>( &hz ) );
|
QueryPerformanceFrequency( reinterpret_cast<LARGE_INTEGER*>( &hz ) );
|
||||||
QueryPerformanceCounter( reinterpret_cast<LARGE_INTEGER*>( &hzo ) );
|
QueryPerformanceCounter( reinterpret_cast<LARGE_INTEGER*>( &hzo ) );
|
||||||
}
|
}
|
||||||
uint64_t t;
|
UInt64 t;
|
||||||
QueryPerformanceCounter( reinterpret_cast<LARGE_INTEGER*>( &t ) );
|
QueryPerformanceCounter( reinterpret_cast<LARGE_INTEGER*>( &t ) );
|
||||||
return ((t-hzo)*1000000)/hz;
|
return ((t-hzo)*1000000)/hz;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
uint64_t getCurrentTicks() {
|
UInt64 getCurrentTicks() {
|
||||||
timeval t;
|
timeval t;
|
||||||
gettimeofday(&t,CATCH_NULL);
|
gettimeofday(&t,CATCH_NULL);
|
||||||
return static_cast<uint64_t>( t.tv_sec ) * 1000000ull + static_cast<uint64_t>( t.tv_usec );
|
return static_cast<UInt64>( t.tv_sec ) * 1000000ull + static_cast<UInt64>( t.tv_usec );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user