Link to home
Start Free TrialLog in
Avatar of drama22
drama22

asked on

delphi prevent click fast

i have this function that detect fast click

  function IsFlood:Boolean;
  var
  i, x : integer;
  begin
    Result := False;
    i := trunc(GetTickCount/2);
    x := trunc((i - LastFloodTime)/4);
    Result := False;
    if x < 180 then Result := True;
    LastFloodTime := i;
  end;

Open in new window


this function uses GetTickCount i want to use Tstopwatch instead any one can convert this function to Tstopwatch ?
ASKER CERTIFIED SOLUTION
Avatar of Geert G
Geert G
Flag of Belgium 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
Avatar of drama22
drama22

ASKER

i dont know if you test this code but its working only one time if i click too many times and very fast it does not detect the fast clicks