Hello all,
I'd like to benchmark the times required for adding points to a TLineSeries and the actual time consumed during redraw. If I understand correctly, the redrawing is performed in next call to message loop.
Is there an example how to benchmark the redraw performance?
Best regards,
Focus
How to benchmark TChart recalc / redraw times?
-
- Newbie
- Posts: 3
- Joined: Wed Apr 14, 2021 12:00 am
Re: How to benchmark TChart recalc / redraw times?
Hello,
You can start a
You can start a
TStopWatch
at the Chart's OnBeforeDraw
event calculate the elapsed time at OnAfterDraw
event. Ie:Code: Select all
uses Diagnostics, TimeSpan;
var stopWatch: TStopwatch;
procedure TForm1.ChartBeforeDraw(Sender: TObject);
begin
label1.Caption:='Drawing...';
stopWatch:=TStopwatch.Create;
stopWatch.Start;
end;
procedure TForm1.ChartAfterDraw(Sender: TObject);
var elapsed: TTimeSpan;
seconds: Double;
begin
elapsed:=stopWatch.Elapsed;
seconds:=elapsed.TotalSeconds;
label1.Caption:='Drawing took ' + FormatFloat('#,##0.##', seconds) + ' seconds';
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |