From 589da3f714fff066405a6e2396f5a47902d1f6e4 Mon Sep 17 00:00:00 2001 From: darkredtitan <70135297+darkredtitan@users.noreply.github.com> Date: Sat, 5 Sep 2020 19:53:16 +0200 Subject: [PATCH] Fix social distancing bug (name trademarked by kamilprzyb) --- src/CNStructs.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/CNStructs.cpp b/src/CNStructs.cpp index c58c6fe..2c4c7b5 100644 --- a/src/CNStructs.cpp +++ b/src/CNStructs.cpp @@ -1,4 +1,7 @@ #include "CNStructs.hpp" +#if defined _MSC_VER +#include +#endif std::string U16toU8(char16_t* src) { try { @@ -27,8 +30,7 @@ uint64_t getTime() { gettimeofday(&tp, NULL); return tp.tv_sec * 1000 + tp.tv_usec / 1000; #else - time_t t; - time(&t); - return (uint64_t)t; +std::chrono::milliseconds value = std::chrono::duration_cast((std::chrono::time_point_cast(std::chrono::high_resolution_clock::now())).time_since_epoch()); +return (uint64_t)(value.count()); #endif } \ No newline at end of file