-6

Please, I need to measure the search time in my pascal program in order to measure the performance efficient.. if there is any function or code to measure the search time?

thanks

zenab
  • 159
  • 1
  • 3
  • 9

2 Answers2

2

Try this

uses DateUtils;
var
  FromTime, ToTime: TDateTime;
  DiffMinutes: Integer;
begin
  FromTime := Now;

  // do your process

  ToTime := Now;
  DiffMinutes := MinutesBetween(ToTime,FromTime);
end;
Bharat
  • 6,828
  • 5
  • 35
  • 56
  • Thank u for replying, I apply it but it is not work because I used Trubo pascal 1.5 ... I think there are another function like TimerCount, GetTickCount, etc. Please, can you help me if u have any coding for this function?? thanks – zenab Jul 22 '10 at 21:09
  • 4
    I'm surprised Turbo Pascal 1.5 even works on Windows 7. – Marco van de Voort Aug 01 '10 at 08:19
0

It didnt work for me either, because Free Pascal dont find the "Now"-Function..

I just add "uses sysutils" in Bharats Answer and it works fine for me!

like:

uses DateUtils, sysutils;
var
  FromTime, ToTime: TDateTime;
  DiffMinutes: Integer;
begin
  FromTime := Now;

  // do your process

  ToTime := Now;
  DiffMinutes := MinutesBetween(ToTime,FromTime);
end;
luuuli
  • 1
  • 1