aboutsummaryrefslogtreecommitdiff
path: root/zencore/timer.cpp
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2021-10-12 14:46:10 +0200
committerMartin Ridgers <[email protected]>2021-10-12 14:46:10 +0200
commit7afea60028346eaff55deaf4f4ddbd213a265e4d (patch)
treee17d8e1d1ec2a0013df10994db28929a86189568 /zencore/timer.cpp
parentAdded "xmake project" output to .gitignore (diff)
parentRatios should not be percentages (this should be done in presentation) (diff)
downloadzen-7afea60028346eaff55deaf4f4ddbd213a265e4d.tar.xz
zen-7afea60028346eaff55deaf4f4ddbd213a265e4d.zip
Merged main
Diffstat (limited to 'zencore/timer.cpp')
-rw-r--r--zencore/timer.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/zencore/timer.cpp b/zencore/timer.cpp
index 9180519bd..1655e912d 100644
--- a/zencore/timer.cpp
+++ b/zencore/timer.cpp
@@ -17,16 +17,20 @@ namespace zen {
uint64_t
GetHifreqTimerValue()
{
+ uint64_t Timestamp;
+
#if ZEN_PLATFORM_WINDOWS
LARGE_INTEGER li;
QueryPerformanceCounter(&li);
- return li.QuadPart;
+ Timestamp = li.QuadPart;
#else
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
- return (uint64_t(ts.tv_sec) * 1000000ull) + (uint64_t(ts.tv_nsec) / 1000ull);
+ Timestamp = (uint64_t(ts.tv_sec) * 1000000ull) + (uint64_t(ts.tv_nsec) / 1000ull);
#endif
+
+ return Timestamp;
}
uint64_t