A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

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, &quot;Victor Stinner&quot; &lt;<a href="mailto:victor.stinner@gmail.com">victor.stinner@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Scott wrote:<br>
&gt;<br>
&gt; &lt;&lt; The Boost implementation can be summarized as:<br>
&gt;<br>
&gt; system_clock:<br>
&gt;<br>
&gt; Â mac = gettimeofday<br>
&gt; Â posix = clock_gettime(CLOCK_REALTIME)<br>
&gt; Â win = GetSystemTimeAsFileTime<br>
&gt;<br>
&gt; steady_clock:<br>
&gt;<br>
&gt; Â mac = mach_absolute_time<br>
&gt; Â posix = clock_gettime(CLOCK_MONOTONIC)<br>
&gt; Â win = QueryPerformanceCounter<br>
&gt;<br>
&gt; high_resolution_clock:<br>
&gt;<br>
&gt; Â * = { steady_clock, if available<br>
&gt; Â  Â  Â  system_clock, otherwise } &gt;&gt;<br>
&gt;<br>
&gt; 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>
&gt;<br>
&gt; 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>

&gt;<br>


&gt;&gt;&gt; I added a time.hires() clock to the PEP for the benchmarking/profiling<br>
&gt;&gt;&gt; use case (...)<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; It is this always-having-to-manually-fallback-depending-on-os that I was<br>
&gt;&gt; hoping your new functionality would avoid. Is time.try_monotonic()<br>
&gt;&gt; suitable for this usecase?<br>
&gt;<br>
&gt;<br>
&gt; If QueryPerformanceCounter() is monotonic, the API can be simplified to:<br>
&gt;<br>
&gt; Â * time.time() = system clock<br>
&gt; Â * time.monotonic() = monotonic clock<br>
&gt; Â * time.hires() = monotonic clock or fallback to system clock<br>
&gt;<br>
&gt; time.hires() definition is exactly what I was trying to implement with &quot;time.steady(strict=True)&quot; / &quot;time.try_monotonic()&quot;.<br>
&gt;<br>
&gt; --<br>
&gt;<br>
&gt; Scott&gt; monotonic_clock = always goes forward but can be adjusted<br>
&gt; Scott&gt; steady_clock = always goes forward and cannot be adjusted<br>
&gt;<br>
&gt; I don&#39;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 &lt; 2.6.28.</p>
<p>Monotonic. It&#39;s still monotonic if it is adjusted forward, and that&#39;s okay. </p>
<p>&gt;<br>
&gt; I don&#39;t know if other clocks used by my time.monotonic() proposition can be adjusted or not.<br>
&gt;<br>
&gt; If I understand correctly, time.steady() cannot be implemented using CLOCK_MONOTONIC on Linux because CLOCK_MONOTONIC can be adjusted?<br>
&gt;<br>
&gt; Does it really matter if a monotonic speed is adjusted?<br>
&gt;<br>
&gt;<br>
&gt; Victor<br>
&gt; _______________________________________________<br>
&gt; Python-Dev mailing list<br>
&gt; <a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
&gt; <a href="http://mail.python.org/mailman/listinfo/python-dev">http://mail.python.org/mailman/listinfo/python-dev</a><br>
&gt; 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