Link to home
Start Free TrialLog in
Avatar of libbysharf
libbysharf

asked on

A more accurate function then now

Hello,
I want to measure the cpu time for a function.

Right now I'm using the function "now" as in:

edit2.text:=timetostr(now);

Obviously I need something more accurate.

Does anyone have any idea?


ASKER CERTIFIED SOLUTION
Avatar of kretzschmar
kretzschmar
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
means


var
  start, stop, elapsed : Integer;
begin
  start := gettickcount;
  //call your function here
  stop := gettickcount;
  elapsed := stop-start;
  edit1.text := inttostr(elapsed) + ' ms'; //in milliseconds
end;

just from head,
typos possible

meikl ;-)
Avatar of libbysharf
libbysharf

ASKER

Wow! That was quick!
Thanks
glad to helped you :-)