Zachary Ware <zachary.w...@gmail.com> 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 
process, and you aren't making the CPU do anything between your checks.

----------
resolution: not a bug -> 
stage: resolved -> 
status: closed -> pending

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37859>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to