Showing content from http://mail.python.org/pipermail/python-dev/attachments/20120328/0f3702ec/attachment.html below:
<p><br>
On Mar 28, 2012 8:38 AM, "Victor Stinner" <<a href="mailto:victor.stinner@gmail.com">victor.stinner@gmail.com</a>> wrote:<br>
><br>
> Scott wrote:<br>
><br>
> << The Boost implementation can be summarized as:<br>
><br>
> system_clock:<br>
><br>
> Â mac = gettimeofday<br>
> Â posix = clock_gettime(CLOCK_REALTIME)<br>
> Â win = GetSystemTimeAsFileTime<br>
><br>
> steady_clock:<br>
><br>
> Â mac = mach_absolute_time<br>
> Â posix = clock_gettime(CLOCK_MONOTONIC)<br>
> Â win = QueryPerformanceCounter<br>
><br>
> high_resolution_clock:<br>
><br>
> Â * = { steady_clock, if available<br>
> Â Â Â system_clock, otherwise } >><br>
><br>
> I read again the doc of the QElapsedTimer class of the Qt library. So Qt and Boost agree to say that QueryPerformanceCounter() *is* monotonic.<br>
><br>
> I was confused because of a bug found in 2006 in Windows XP on multicore processors. QueryPerformanceCounter() gave a different value on each core. The bug was fixed in Windows and is known as KB896256 (I already added a link to the bug in the PEP).<br>
><br>
>>> I added a time.hires() clock to the PEP for the benchmarking/profiling<br>
>>> use case (...)<br>
>><br>
>><br>
>> It is this always-having-to-manually-fallback-depending-on-os that I was<br>
>> hoping your new functionality would avoid. Is time.try_monotonic()<br>
>> suitable for this usecase?<br>
><br>
><br>
> If QueryPerformanceCounter() is monotonic, the API can be simplified to:<br>
><br>
> Â * time.time() = system clock<br>
> Â * time.monotonic() = monotonic clock<br>
> Â * time.hires() = monotonic clock or fallback to system clock<br>
><br>
> time.hires() definition is exactly what I was trying to implement with "time.steady(strict=True)" / "time.try_monotonic()".<br>
><br>
> --<br>
><br>
> Scott> monotonic_clock = always goes forward but can be adjusted<br>
> Scott> steady_clock = always goes forward and cannot be adjusted<br>
><br>
> I don't know if the monotonic clock should be called time.monotonic() or time.steady(). The clock speed can be adjusted by NTP, at least on Linux < 2.6.28.</p>
<p>Monotonic. It's still monotonic if it is adjusted forward, and that's okay. </p>
<p>><br>
> I don't know if other clocks used by my time.monotonic() proposition can be adjusted or not.<br>
><br>
> If I understand correctly, time.steady() cannot be implemented using CLOCK_MONOTONIC on Linux because CLOCK_MONOTONIC can be adjusted?<br>
><br>
> Does it really matter if a monotonic speed is adjusted?<br>
><br>
><br>
> Victor<br>
> _______________________________________________<br>
> Python-Dev mailing list<br>
> <a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
> <a href="http://mail.python.org/mailman/listinfo/python-dev">http://mail.python.org/mailman/listinfo/python-dev</a><br>
> Unsubscribe: <a href="http://mail.python.org/mailman/options/python-dev/anacrolix%40gmail.com">http://mail.python.org/mailman/options/python-dev/anacrolix%40gmail.com</a><br>
</p>
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4