Antoine Pitrou skrev:
Well... interpreter ticks only measures the number of opcodes executed, not the number of seconds elapsed. It's not a reliable performance measure at all, unless you want to measure ticking itself.
I did not mention that: In Windows we get precise timings using QueryPerformanceCounter and QueryPerformanceFrequency. On Linux it would be uclock and UCLOCKS_PER_SEC. An C extension using the proposed API would have to call these functions itself. The proposed registers are thus not for timing, but for measuring how many times the interpreter has ticked and tocked. Or we could make it easier to write cross-platform extensions and have a function that retreives these numbers together with a high-precision timing in microseconds: int PyEval_GetPerformanceStats( PY_LONG_LONG *ticks, PY_LONG_LONG *checks, double *us); Sturla Molden