forcing output to the screen

I am running a simulation in a loop doing a lot of calculations.
Because these simulations take a lot of time I want to display an indication of the progress on the screen at regular intervals. I tell the software:

Label5.text = Str(nwhiles * 500)+"    "+Str(p_new)+"   "+Str(p_diff)
beep
Window_parms.refresh

trying to force an update of the contents of window_parms and label5.text on that window_parms.

I hear the beep, but nothing appears on the screen apparently because the calculations prevent the output. I thought that refresh would force redrawing of the window.

Is there a way to force the intermediate output to the screen?
Can I use a timer???
Dick

See This

Thanks. I’ve put the calculations in a thread and use a global variable to check from a timer. The timer also allows me to output to the screen.