How to perform regular screen refresh while processing?
Posted on 2008-10-26
my application is processing data and it can take up to 10 minutes to do. It can make tens of millions of cycles... to have some sort of screen refresh and indicator I put this to every main procedure :
if counter mod 10000 then
StatusForm.myLabel.Caption := 'Procesing #'+myIndicatorNo;
Now, this works OK. Obivously with 'IF' I make sure that refresh doesn't take too much of resources, because it CAN, at least in my application!
Now, I would like to have another, easier and much less code approach. So I was thinking of having a Timer that would do the same think every second.
Is this possible? Can Timer take a lot of resources, while waiting for 1 sec to pass? Is this, being executed on Timer event, actually possible in one-threaded application?
If this is possible for my application, please give me some pointers.