Hacker News new | ask | show | jobs
by accrual 475 days ago
Same here. I often implemented like this, where n was some reasonable value:

    if iteration % n === 0:
        update_progress()
1 comments

I normally do it with a bitwise and of numbers that end with a sequence of 1s, like 7. so `i & 7 == 7`