I am trying to migrate from Delphi 6 to Delphi 2010, but I cannot find the GetTickCount
function in Delphi 2010. I have IdGlobal
, SysUtils
, and DateUtils
in my uses clause.
var
RefreshTick : Cardinal;
begin
RefreshTick := GetTickCount;
end;
It gives me an error:
Undeclared identifier : GetTickCount
What's an alternative to this?
The GetTickCount
function is part of the Windows unit.
As you've since discovered, the GetTickCount
function you were using was provided by the IdGlobal unit. It had the same name as a Windows API function. The function you were using is now named Ticks
. Either add Windows to your uses clause to get the API function, or change your code to use the new name instead.
It looks like the name change came sometime in 2004. You should try to be more diligent about keeping your Indy library up to date. Don't just use the version that comes with Delphi — it was probably outdated before you even got it. Always download the latest version from Indy's source control.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With