Clock update in a thread
Posted on 2003-11-15
I have an application that displays the date & time using a timer and a labels caption as below.
procedure TfmMain.Timer1Timer(Sender: TObject);
laDateTime.Caption := DateTimeToStr(Now);
This works fine except when a long process is executing e.g. when generating a chart the time updates every few seconds and skips seconds. I have tried Application.ProcessMessages and reducing the timer interval but it is still not correct.
Is it possible for the time to be updated accurately by running it in its own TThread ?.