Changeset View
Changeset View
Standalone View
Standalone View
extern/draco/draco/src/draco/core/cycle_timer.cc
- This file was moved from extern/draco/dracoenc/src/draco/core/cycle_timer.cc.
| Show All 13 Lines | |||||
| // | // | ||||
| #include "draco/core/cycle_timer.h" | #include "draco/core/cycle_timer.h" | ||||
| namespace draco { | namespace draco { | ||||
| void DracoTimer::Start() { | void DracoTimer::Start() { | ||||
| #ifdef _WIN32 | #ifdef _WIN32 | ||||
| QueryPerformanceCounter(&tv_start); | QueryPerformanceCounter(&tv_start); | ||||
| #else | #else | ||||
| gettimeofday(&tv_start, NULL); | gettimeofday(&tv_start, nullptr); | ||||
| #endif | #endif | ||||
| } | } | ||||
| void DracoTimer::Stop() { | void DracoTimer::Stop() { | ||||
| #ifdef _WIN32 | #ifdef _WIN32 | ||||
| QueryPerformanceCounter(&tv_end); | QueryPerformanceCounter(&tv_end); | ||||
| #else | #else | ||||
| gettimeofday(&tv_end, NULL); | gettimeofday(&tv_end, nullptr); | ||||
| #endif | #endif | ||||
| } | } | ||||
| int64_t DracoTimer::GetInMs() { | int64_t DracoTimer::GetInMs() { | ||||
| #ifdef _WIN32 | #ifdef _WIN32 | ||||
| LARGE_INTEGER elapsed = {0}; | LARGE_INTEGER elapsed = {0}; | ||||
| elapsed.QuadPart = tv_end.QuadPart - tv_start.QuadPart; | elapsed.QuadPart = tv_end.QuadPart - tv_start.QuadPart; | ||||
| Show All 11 Lines | |||||