Re: How to time the execution of a method?
- From: "Maarten Wiltink" <maarten@xxxxxxxxxxxxxxxxxx>
- Date: Wed, 24 Oct 2007 09:57:11 +0200
"Robert Baker" <korax1214@xxxxxxxxx> wrote in message
news:ffrsh31jdatffuit1eqd78socd3s6pa6e3@xxxxxxxxxx
[...]
The problem is that I have three possible algorithms to [do something],
and I want to know which is the most efficient on average.
I've tried using the following:
function TimeMethod(x: TMethod): TDateTime;
var s,e: TDateTime;
begin
s:=Now;
x;
e:=Now;
TimeMethod:=86400*(e-s);
end;
ta:=TimeMethod(DrawA);
tb:=TimeMethod(DrawB);
tc:=TimeMethod(DrawC);
This doesn't work. Please advise.
Define "doesn't work". Then measure over doing it 10,000 times.
By the way, nice job with the procedural parameter. However, if
you start with a TDateTime and multiply it by 86,400, you no longer
have a TDateTime.
Groetjes,
Maarten Wiltink
.
- Follow-Ups:
- Re: How to time the execution of a method?
- From: Dr J R Stockton
- Re: How to time the execution of a method?
- References:
- How to time the execution of a method?
- From: Robert Baker
- How to time the execution of a method?
- Prev by Date: Popup Menu's Parent/Owner Component
- Next by Date: Re: Popup Menu's Parent/Owner Component
- Previous by thread: How to time the execution of a method?
- Next by thread: Re: How to time the execution of a method?
- Index(es):
Relevant Pages
|