From: <sv...@ww...> - 2004-12-11 19:02:30
|
Author: mkrose Date: 2004-12-11 11:02:24 -0800 (Sat, 11 Dec 2004) New Revision: 1367 Modified: trunk/CSP/SimData/CHANGES.current trunk/CSP/SimData/Source/Timing.cpp Log: Fix a dumb bug in the timing code that caused wildly inaccurate times on windows. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1367 Modified: trunk/CSP/SimData/CHANGES.current =================================================================== --- trunk/CSP/SimData/CHANGES.current 2004-12-07 18:03:09 UTC (rev 1366) +++ trunk/CSP/SimData/CHANGES.current 2004-12-11 19:02:24 UTC (rev 1367) @@ -1,12 +1,16 @@ Version 0.4.0 (in progress) =========================== +2004-12-11: onsight + * Fix a dumb bug in the timing code that caused wildly inaccurate + times on windows. + 2004-12-06: delta * Changed the level of warnings of cSimData_wrap.cpp and compiled Config as a multithreads dll (vc project files). - + * Cleaned a useless vc specific pragma. - + * Removed useless static_cast<> in Date.cpp. 2004-12-06: onsight Modified: trunk/CSP/SimData/Source/Timing.cpp =================================================================== --- trunk/CSP/SimData/Source/Timing.cpp 2004-12-07 18:03:09 UTC (rev 1366) +++ trunk/CSP/SimData/Source/Timing.cpp 2004-12-11 19:02:24 UTC (rev 1367) @@ -156,7 +156,7 @@ counter_offset = 1e-7 * static_cast<double>(first_time - SIMDATA_ULL(116444736000000000)); } else { uint64 elapsed_count = counter - first_counter; - uint64 elapsed_time = cvt_filetime(update_time); + uint64 elapsed_time = cvt_filetime(update_time) - first_time; double new_scale = static_cast<double>(elapsed_time) * 1e-7 / elapsed_count; // bump the offset to keep the current calibrated time continuous counter_offset += elapsed_count * (counter_scale - new_scale); |