Monday, July 28, 2025

Maybe going to revive the blog with some Delphi ramblings

 Timing procedure on execution duration.

After reading it in many books, and a need to know whether to go PPL (Primoz G says to better stay away from it if you can, in his book "Delphi High Performance"), I finally created a timing unit that makes sense to me. It keeps track of some data in a simple ".csv" file for analyzing with Excel or LibreOffice and doesn't have a huge impact on the procedural execution time.

Data: "PROJECT,APPLICATION,CLASS,METHOD,RUNTIME,COUNT,ITEM,COMMENT"

Application in procedure or function

begin

CLOCK.StartOfLife('TCheckFileForData.ProcessCncFiles');

//Do the work with some kind of loop

CLOCK.EndOfLife('Count,Item,Comment');

end;

I'm adding this to every procedure that I am expecting to take some time.

Advantage is also you can measure the effect of a refactoring or output to a form (usually this is pretty high).

Sometimes I need to check vast numbers of, fairly simple, CNC data files.

It is not uncommon to process 4-5000 files which will take about 4 seconds, the creation of an Excel report, on the other hand, will take about 9 seconds using a template.

(I am using a BeeLink SER8, Processor AMD Ryzen 7 8845HS with Radeon 780M Graphics, 3801 Mhz, 8 Core(s), 16 Logical Processora)

Maybe going to revive the blog with some Delphi ramblings

 Timing procedure on execution duration. After reading it in many books, and a need to know whether to go PPL (Primoz G says to better stay ...