[issue37859] time.process_time() constant / erratic on Windows

2019-08-14 Thread STINNER Victor
STINNER Victor added the comment: > I see that now. The behaviour was different in Linux, though, I suppose it > may benefit from a more precise counter, but since in Windows it also has a > precise counter with time.perf_counter_ns(), I was expecting to see that > value change, but it was m

[issue37859] time.process_time() constant / erratic on Windows

2019-08-14 Thread STINNER Victor
STINNER Victor added the comment: > Process times [1] are stored as a 64-bit integer in units of 100 ns (1e-7). > But the kernel schedules threads based on a timer that ticks every 15.625 ms > by default. It can be lowered to about 0.5 ms, but this degrades battery life. Patches are welcome

[issue37859] time.process_time() constant / erratic on Windows

2019-08-14 Thread Eryk Sun
Eryk Sun added the comment: > I suppose it may benefit from a more precise counter, but since in > Windows it also has a precise counter with time.perf_counter_ns(), > I was expecting to see that value change, but it was mainly a > confusion with the older time.clock(). Don't read too much

[issue37859] time.process_time() constant / erratic on Windows

2019-08-14 Thread Red Glyph
Red Glyph added the comment: I see that now. The behaviour was different in Linux, though, I suppose it may benefit from a more precise counter, but since in Windows it also has a precise counter with time.perf_counter_ns(), I was expecting to see that value change, but it was mainly a confu

[issue37859] time.process_time() constant / erratic on Windows

2019-08-14 Thread Zachary Ware
Change by Zachary Ware : -- resolution: -> not a bug stage: -> resolved status: pending -> closed ___ Python tracker ___ ___ Pytho

[issue37859] time.process_time() constant / erratic on Windows

2019-08-14 Thread Zachary Ware
Zachary Ware added the comment: Try this: while time.process_time() < 0.5: print('.', flush=True, end='') Or: >>> time.process_time() 0.03125 >>> len(str(2**500_000)) 150515 >>> time.process_time() 0.484375 Basically, process_time() (and process_time_ns()) measure CPU time used by the

[issue37859] time.process_time() constant / erratic on Windows

2019-08-14 Thread Red Glyph
Change by Red Glyph : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs

[issue37859] time.process_time() constant / erratic on Windows

2019-08-14 Thread Red Glyph
New submission from Red Glyph : Tested with - Python 3.7.4, 64-bit, Windows version (installer version) - python-3.8.0b3-embed-amd64.zip - python-3.7.2.post1-embed-amd64.zip on Windows 7 x64 Professional time.process_time() always returns the same value. If I check the value of time.process_