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?
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Wow! That was quick!
Thanks
Thanks
glad to helped you :-)
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 ;-)