2009-09-13 04:46:25 -04:00
|
|
|
program new;
|
|
|
|
var
|
|
|
|
x,y,w,h,i,j,t,t2:integer;
|
|
|
|
begin
|
|
|
|
getclientdimensions(w,h);
|
2009-09-28 22:12:29 -04:00
|
|
|
writeln(inttostr(w) + ', ' + inttostr(h));
|
2009-09-13 04:46:25 -04:00
|
|
|
|
2009-09-28 22:12:29 -04:00
|
|
|
freeze();
|
2009-09-13 04:46:25 -04:00
|
|
|
for i := 0 to 2 do
|
|
|
|
begin
|
|
|
|
setcolortolerancespeed(i);
|
|
|
|
t := getsystemtime;
|
|
|
|
for j := 0 to 100 do
|
2009-09-28 22:12:29 -04:00
|
|
|
findcolortolerance(x, y, 2532562, 0, 0, w -1 , h -1, 1);
|
2009-09-13 04:46:25 -04:00
|
|
|
t2 := getsystemtime;
|
|
|
|
writeln('Time for 101 tries: ' + inttostr(t2 - t) + ' ms.');
|
|
|
|
writeln('That is ' + FloatToStr((t2 - t) / 101) + ' ms each.');
|
|
|
|
|
2009-09-28 22:12:29 -04:00
|
|
|
if findcolortolerance(x, y, 2532562, 0, 0, w-1, h-1, 1) then
|
2009-09-13 04:46:25 -04:00
|
|
|
begin
|
|
|
|
writeln('CTS: ' + inttostr(I) + '; Found the colour at (' + inttostr(x) + ', ' +
|
|
|
|
inttostr(y) + ')');
|
|
|
|
movemouse(x, y);
|
|
|
|
wait(1000);
|
|
|
|
end else
|
|
|
|
writeln('not found');
|
|
|
|
end;
|
2009-09-28 22:12:29 -04:00
|
|
|
unfreeze();
|
2009-09-13 04:46:25 -04:00
|
|
|
end.
|
|
|
|
|
|
|
|
Compiled succesfully in 7 ms.
|
|
|
|
826, 597
|
|
|
|
Time for 101 tries: 1143 ms.
|
|
|
|
That is 11.316831683168 ms each.
|
|
|
|
not found
|
|
|
|
Time for 101 tries: 2565 ms.
|
|
|
|
That is 25.396039603960 ms each.
|
|
|
|
not found
|
|
|
|
Time for 101 tries: 3799 ms.
|
|
|
|
That is 37.613861386139 ms each.
|
|
|
|
not found
|
|
|
|
Succesfully executed
|
|
|
|
|