From 3da6b4709c2d049f7f1aeab51cdaf3d2a7cba7d1 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 29 Nov 2020 20:23:33 -0500 Subject: [PATCH] Fixes sign of arithmetic. --- OSBindings/Mac/Clock Signal/Machine/CSMachine.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OSBindings/Mac/Clock Signal/Machine/CSMachine.mm b/OSBindings/Mac/Clock Signal/Machine/CSMachine.mm index 540035c0e..8e4436189 100644 --- a/OSBindings/Mac/Clock Signal/Machine/CSMachine.mm +++ b/OSBindings/Mac/Clock Signal/Machine/CSMachine.mm @@ -720,8 +720,10 @@ struct ActivityObserver: public Activity::Observer { @synchronized(self) { // Store a means to map from CVTimeStamp.hostTime to Time::Nanos; // there is an extremely dodgy assumption here that the former is in ns. + // If you can find a well-defined way to get the CVTimeStamp.hostTime units, + // whether at runtime or via preprocessor define, I'd love to know about it. if(!_timeDiff) { - _timeDiff = int64_t(now->hostTime) - int64_t(timeNow); + _timeDiff = int64_t(timeNow) - int64_t(now->hostTime); } // Store the next end-of-frame time. TODO: and start of next and implied visible duration, if raster racing?