I don't know if it works for freepascal and/or lazarus (probably not), but there is a free Delphi profiler program you can find here:

http://delphitools.info/

cheers,
Paul