Canister:limit for single message execution

Hi!
Yes. You got it right.
1)How can I organize the tracking of rounds in the code?
I tried with
system func heartbeat(): async(){ };
But so far not very successful.

Deterministic Time Slicing

I think this will fix the situation, but there are peculiarities with the size of the transmitted data in canisters. So there will still be nuances in the code (depending on the functional load)
Thanks!