I created a timer but for some reason the timer randomly stops updating until I click the tkinter window then it starts to update again. This happens about every minute or two. Here is my code:
from tkinter import *
from threading import Thread
tk = Tk()
tk.attributes('-alpha',1)
tk ['bg']='#302F2F'
tk.title('')
tk.wm_attributes('-topmost', 1) # put the window to front
def timer():
while True:
sleep(0.009)
...
#cut out all the stuff of creating the time but here is how i did it
label['text'] = (ftime2)
label['fg'] = colorfortext
label2['text'] = (ftime)
label2['fg'] = colorfortext
label3['text'] = (numberofworlds)
label3['fg'] = 'blue'
label = Label(tk, '', font=('Arial', 30),bg='#302F2F')
label.grid(columnspan=2)
label2 = Label(tk, '', font=('Arial', 30),bg='#302F2F')
label2.grid(columnspan=2)
label3 = Label(tk, '', font=('Arial', 30),bg='#302F2F')
label3.grid(columnspan=2)
timer_thread = Thread(target=timer)
timer_thread.start()
tk.mainloop()