[fpc-pascal]Performance testing of FPC programs?

Lee, John John.Lee at logicacmg.com
Fri Feb 7 18:33:10 CET 2003

2 choices, use profiling (see Marco's response), which is ok but a bit
cumbersome IMHO, or add your own timing (this is what I do). I use clock
from Tomas Schatzl's cpu unit which works for most o/s and also different
pascals eg vpasc, fpc etc (1 microsec accuracy) and put in timing statements
in the code, with a compiler conditional eg

uses cpu;
...stuff to be timed....
{$ifdef time_it writeln('time to here=',clock-t); {$endif}

I then move the timing statement(s) until I find the bottleneck- usually
pretty easy & then look at the code, change & retime...

Regards John

Hi all, I have a relatively large FPC program that I suspect have a few
bottlenecks (regarding processing speed). Are there any ways I can test how
long time the program spends in the different procedures/functions?

Best regards Preben

This e-mail and any attachment is for authorised use by the intended recipient(s) only.  It may contain proprietary material, confidential information and/or be subject to legal privilege.  It should not be copied, disclosed to, retained or used by, any other party.  If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender.  Thank you.

More information about the fpc-pascal mailing list