From fe739f8c2647fef4fdd5426dc2a27b61614dba7f Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Fri, 22 May 2020 18:06:13 +1000 Subject: GHOST: fix GHOST_System::getMilliSeconds() This wasn't returning milliseconds, causing problems with key repeat. --- intern/ghost/intern/GHOST_System.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'intern') diff --git a/intern/ghost/intern/GHOST_System.cpp b/intern/ghost/intern/GHOST_System.cpp index 587e4c28102..b0d2adff4bc 100644 --- a/intern/ghost/intern/GHOST_System.cpp +++ b/intern/ghost/intern/GHOST_System.cpp @@ -23,8 +23,8 @@ #include "GHOST_System.h" +#include #include /* just for printf */ -#include #include "GHOST_DisplayManager.h" #include "GHOST_EventManager.h" @@ -58,12 +58,9 @@ GHOST_System::~GHOST_System() GHOST_TUns64 GHOST_System::getMilliSeconds() const { - GHOST_TUns64 millis = ::clock(); - if (CLOCKS_PER_SEC != 1000) { - millis *= 1000; - millis /= CLOCKS_PER_SEC; - } - return millis; + return std::chrono::duration_cast( + std::chrono::steady_clock::now().time_since_epoch()) + .count(); } GHOST_ITimerTask *GHOST_System::installTimer(GHOST_TUns64 delay, -- cgit v1.2.3