1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-23 14:25:11 +00:00

Experimentally switches to a 'high-resolution' clock for SDL.

This commit is contained in:
Thomas Harte
2020-02-09 21:44:55 -05:00
parent f1cd35fa16
commit 705d14259c
3 changed files with 62 additions and 18 deletions
+7
View File
@@ -9,9 +9,16 @@
#ifndef TimeTypes_h
#define TimeTypes_h
#include <chrono>
namespace Time {
typedef double Seconds;
typedef int64_t Nanos;
inline Nanos nanos_now() {
return std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::high_resolution_clock::now().time_since_epoch()).count();
}
}