code: def call_sync_callbacks(self):
          
          current_cycles = self.cycles
          for callback_cycles, callback in self.sync_callbacks:
              # get the CPU cycles count of the last call
              last_call_cycles = self.sync_callbacks_cyles[callback]
  
              if current_cycles - last_call_cycles > callback_cycles:
                  # this callback should be called
  
                  # Save the current cycles, to trigger the next call
                  self.sync_callbacks_cyles[callback] = self.cycles
  
                  # Call the callback function
                  callback(current_cycles - last_call_cycles)
docs: Call every sync callback with CPU cycles trigger