File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
source/gameanalytics/Platform Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -259,8 +259,9 @@ int64_t gameanalytics::GAPlatformMacOS::getBootTime() const
259259 struct timeval currentTime = {};
260260
261261 gettimeofday (¤tTime, NULL );
262-
263- return currentTime.tv_sec - startTime.tv_sec ;
262+
263+ int64_t remainingMs = static_cast <double >(currentTime.tv_usec - startTime.tv_usec ) * 1e-3 ;
264+ return (currentTime.tv_sec - startTime.tv_sec ) * 1000 + remainingMs;
264265}
265266
266267#endif
Original file line number Diff line number Diff line change @@ -332,7 +332,7 @@ int64_t GAPlatformWin32::getBootTime() const
332332
333333 // filetime is expressed in 100s of nanoseconds
334334 std::chrono::nanoseconds timeInNs = std::chrono::nanoseconds (value * 100 );
335- return std::chrono::duration_cast<std::chrono::seconds >(timeInNs).count ();
335+ return std::chrono::duration_cast<std::chrono::milliseconds >(timeInNs).count ();
336336 }
337337
338338 return 0ll ;
You can’t perform that action at this time.
0 commit comments