Puoi usare un timer o anche un secondo thread ... dipende dall'architettura del tuo codice ...