import threading as th
import time
a=0
def funcion1():
    global contador
    contador = 0
    while True:
        time.sleep(1)
        contador=contador+1
        
hilo1 = th.Thread(target=funcion1)
hilo1.start()
num = contador
while True:
    if num != contador:
        print(contador)
        num=contador
