[DUG] TTimer
Cleon Pinto
capinto at gmail.com
Thu Jul 20 11:16:25 NZST 2006
I haven't had any problems with the timer but maybe you could try
removing the wakeclock code and change the timer code to something
like:
procedure TfrmJBCLMenu1.Timer1Timer(Sender: TObject);
begin
timer1.Enabled:=false;
try
lblToday.caption:=formatDateTime('dd mmm yy - hh:nn:ss',now);
finally
timer1.Enabled:=true;
end
end;
just a thought... don't know if it'll fix your problem
Cleon.
On 7/20/06, John Bird <johnkbird at paradise.net.nz> wrote:
> I have a couple of applications with a timer loop that is prone to
> occasionally freezing after a few hours, not doing anything radical, for
> example displaying a date and time.
>
> procedure TfrmJBCLMenu1.Timer1Timer(Sender: TObject);
> begin
>
> lblToday.caption:=formatDateTime('dd mmm yy - hh:nn:ss',now);
>
> end;
>
>
> I noticed when the timer has stopped running that the rest of the
> application runs ok, but seems also a bit sluggish, that is buttons respond
> but slowly.
>
> I put a bit of wake up code run when certain buttons are pressed like
>
> //clock sometimes freezes...
> procedure TfrmJBCLMenu1.WakeClock;
> begin
> timer1.Enabled:=false;
> sleep(500);
> timer1.Enabled:=true;
> end;
>
> But I am thinking this shouldn't be needed!, and I am not sure it always
> fixes it anyway.
>
> Any suggestions to stop timers freezing? Any known problems?
>
> John
>
> _______________________________________________
> Delphi mailing list
> Delphi at ns3.123.co.nz
> http://ns3.123.co.nz/mailman/listinfo/delphi
>
More information about the Delphi
mailing list