是否可以在fps中使用.after()-方法而不是定义毫秒。所以我想要一个6帧(60赫兹)的标签。 -->;根。后(6) 而不是用毫秒来定义时间
例如:
root = tk.Tk()
ListofStimuli = ["\u00B6","\u0126"]
labelprint = tk.Label(root,text="+", font = ('Sans','80','bold'), bg = "white")
labelprint.place(relx=.5, rely=.5, anchor="c")
for elem in ListofStimuli:
labelprint.config(text=elem)
root.after(100, lambda: var.set(0))
root.wait_variable(var)
按照这一思路,保留循环的运行时间列表;然后从首选的UI刷新率中减去平均刷新率。在纳米尺度上迭代地向首选刷新率移动,以解释时序不规则性。在
这将在大约1秒内达到并保持1ms精度,这与after()方法允许的精度一样精确,给定的输入是milleseconds的整数。这种方法适用于任何最小到千分之一秒的刻度。在
相关问题 更多 >
编程相关推荐