Rewrites the GetTickCount interfaces to preserve backwards compatibility, to more closely resamble the WinAPI and also avoid confusion

git-svn-id: trunk@33563 -
This commit is contained in:
sekelsenmat 2011-11-16 12:35:55 +00:00
parent 965ae5eba4
commit 027d11ac6a
2 changed files with 14 additions and 8 deletions

View File

@ -8,7 +8,7 @@ uses
SysUtils;
function NowUTC: TDateTime;
function GetTickCount: Int64;
function GetTickCount64: QWord;
implementation
@ -31,9 +31,9 @@ begin
result := systemTimeToDateTime(SystemTime);
end;
// GetTickCount64 is better, but we need to check the Windows version to use it
function GetTickCount: Int64;
function GetTickCount64: QWord;
begin
// GetTickCount64 is better, but we need to check the Windows version to use it
Result := Windows.GetTickCount();
end;
@ -97,7 +97,7 @@ begin
result := systemTimeToDateTime(SystemTime);
end;
function GetTickCount: Int64;
function GetTickCount64: QWord;
var
tp: TTimeVal;
begin
@ -111,7 +111,7 @@ begin
Result := Now;
end;
function GetTickCount: Int64;
function GetTickCount64: QWord;
begin
Result := Trunc(Now * 24 * 60 * 60 * 1000);
end;

View File

@ -71,7 +71,8 @@ function PredefinedClipboardFormat(
function MsgKeyDataToShiftState(KeyData: PtrInt): TShiftState;
function GetTickCount(): Int64;
function GetTickCount(): DWord;
function GetTickCount64(): QWord;
{$IFDEF DebugLCL}
function GetTickStep: DWord;
@ -136,9 +137,14 @@ begin
end;
end;
function GetTickCount(): Int64;
function GetTickCount(): DWord;
begin
Result := lazutf8sysutils.GetTickCount();
Result := DWord(lazutf8sysutils.GetTickCount64());
end;
function GetTickCount64(): QWord;
begin
Result := lazutf8sysutils.GetTickCount64();
end;
{$IFDEF DebugLCL}