hai provato ad usare la funzione setInterval?