summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2017-12-19 22:21:17 +0100
committerPaweł Redman <pawel.redman@gmail.com>2017-12-19 22:21:17 +0100
commit9628c2c097b10f22aafd4890ab8e98375b5740da (patch)
treec3ae35b5e7cd3f5e525ad85a3dad551f84996cfb /src/main.cpp
parent949eb704c7954ae3646895e4a3d957d0d219142a (diff)
Replace clock_gettime with std::chrono.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/main.cpp b/src/main.cpp
index f45fb24..71e47be 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -16,7 +16,7 @@ along with Minitrem. If not, see <http://www.gnu.org/licenses/>.
*/
#include "common.hpp"
-#include <ctime>
+#include <chrono>
bool debug_draw_cmodels = false;
bool debug_draw_paths = false;
@@ -26,10 +26,7 @@ render::state_t *debug_render;
uint64_t nano_clock(void)
{
- struct timespec ts;
-
- clock_gettime(CLOCK_MONOTONIC_RAW, &ts);
- return ts.tv_sec * 1000000000LLU + ts.tv_nsec;
+ return std::chrono::high_resolution_clock::now().time_since_epoch() / std::chrono::nanoseconds(1);
}
int main()