Message349746
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. |
|
Date |
User |
Action |
Args |
2019-08-14 20:47:45 | zach.ware | set | recipients:
+ zach.ware, paul.moore, tim.golden, steve.dower, Red Glyph |
2019-08-14 20:47:45 | zach.ware | set | messageid: <1565815665.05.0.858493151151.issue37859@roundup.psfhosted.org> |
2019-08-14 20:47:45 | zach.ware | link | issue37859 messages |
2019-08-14 20:47:44 | zach.ware | create | |
|