Looks much nicer now. You're down to 1 division, one multiplication and one addition per call.
Just one last thing to suggest, since rollovers occure so infrequently, there's a lot of wasted cpu cycles recalcualting
rollover * rollover_count for each function call. I suggest that you store the result as static local and update it only after each rollover event.
Quote:
Tell me if I can give you a hand in return someday
|
You've already helped me several times now!!! I'm just trying to keep pace with you 