def __init__(self, evManager, fps): if fps == 0: fps = 100 #100 fps is the maximum timer resolution anyway Clock.__init__(self, fps) self._em = evManager self._em.reg_cb(QuitEvent, self.on_quit)
def __init__(self, evManager): self._em = evManager fps = config_get_fps() if fps <= 0 or fps > 100: fps = 100 #100 fps is the maximum timer resolution anyway Clock.__init__(self, fps) # slice = set of frames between 2 logging self.slice_size = config_get_logperiod() * fps # number of frames in the slice self.slice_start_time = time.time() # the first slice starts now self.slice_work_time = 0 # cumulated time worked for a frame slice self.cumul_ucpu_time = 0 # cumulated userland cpu time used since process started self.cumul_kcpu_time = 0 # cumulated kernel cpu time used since process started self.cumul_vcsw = 0 # cumulated voluntary context switches, posix OS only self.cumul_nvcsw = 0 # cumulated involuntary switches, posix OS only