def start_timer(self, pobj, data): self.fdform0.ldata += 200.0 numldata = self.fdform0.ldata / 1000 buf = "Timer accuracy testing %.3f sec ..." % numldata xfl.fl_set_object_label(self.fdform0.report, buf) self.start_sec, self.start_usec = xfl.fl_gettime() xfl.fl_set_timer(self.fdform0.timer, numldata)
def timer_cb(self, idt, data): timerval = 1.0e-3 * self.fd_form.ldata self.fd_form.timer_id = 0 end_sec, end_usec = xfl.fl_gettime() df = end_sec - self.start_sec + 1.0e-6 * (end_usec - self.start_usec) buf = "Timeout: %.3f Actual: %.3f DeltaE: %.3f" % \ (timerval, df, df - timerval) xfl.fl_set_object_label(self.fd_form.report, buf)
def start_timer(self, pobj, data): if self.fd_form.timer_id: xfl.fl_remove_timeout(self.fd_form.timer_id) self.fd_form.ldata += 200 buf = "Timer accuracy testing %.3f sec ..." % \ float(self.fd_form.ldata * 0.001) xfl.fl_set_object_label(self.fd_form.report, buf) self.start_sec, self.start_usec = xfl.fl_gettime() self.fd_form.timer_id = xfl.fl_add_timeout(self.fd_form.ldata, \ self.timer_cb, 0)
def timer_cb(self, pobj, data): timerval = self.fdform0.ldata * 0.001 end_sec, end_usec = xfl.fl_gettime() df = end_sec - self.start_sec + (end_usec - self.start_usec) * 1.0e-6 buf = "Timeout: %.3f Actual: %.3f DeltaE: %.3f" % (timerval, df, df - timerval) xfl.fl_set_object_label(self.fdform0.report, buf)