[Python-Dev] this is why we shouldn't call it a "monotonic clock" (was: PEP 418 is too divisive and confusing and should be postponed)
cs at zip.com.au
Mon Apr 9 04:54:42 CEST 2012
On 09Apr2012 02:00, Victor Stinner <victor.stinner at gmail.com> wrote:
| > I personally have a need for one potentially different clock -- to
| > measure short intervals for benchmarks and profiling. This might be
| > called time.performancetimer()?
| I deferred this topic because it is unclear to me if such timer has to
| count elapsed time during a sleep or not. For example, time.clock()
| does on UNIX, whereas it doesn't on Windows. You may need two clocks
| for this:
| * time.perf_counter(): high-resolution timer for benchmarking, count
| time elasped during a sleep
For POSIX, sounds like CLOCK_MONOTONIC_RAW to me.
| * time.process_time(): High-resolution (?) per-process timer from the
| CPU. (other possible names: time.process_cpu_time() or
POSIX offers CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID that
seem to suit this need, depending on your threading situation (and what
| On Windows, GetProcessTimes() has not a "high-resolution": it has a
| accuracy of 1 ms in the best case.
says "100-nanosecond time units".
Am I going to the wrong place to learn about these functions?
Cameron Simpson <cs at zip.com.au> DoD#743
I distrust a research person who is always obviously busy on a task.
- Robert Frosch, VP, GM Research
More information about the Python-Dev