warnings.warn("Reported average frame interval (%.1f ms) doesn't match the set interval (%.1f ms). Using the average now."%(avg_interval,interval),RuntimeWarning)
interval=avg_interval
ifintervalisNoneorinterval<=0:
# In some cases, both keys are not saved. Then try to calculate it.