3 ms·
Same here. I often implemented like this, where n was some reasonable value: if iteration % n === 0: update_progress()
by accrual 2y ago
Same here. I often implemented like this, where n was some reasonable value:
if iteration % n === 0:
update_progress()
- guappa 2y agoI normally do it with a bitwise and of numbers that end with a sequence of 1s, like 7. so `i & 7 == 7`