Einzelnen Beitrag anzeigen

Glados
(Gast)

n/a Beiträge
 
#10

AW: Windows.GetTickCount64 auch unter Windows XP?

  Alt 11. Okt 2017, 14:07
Ich habe das jetzt so gelößt

Delphi-Quellcode:
unit uGetTickCount64;

interface

uses
 Winapi.Windows, System.SysUtils;

threadvar High: UInt64;
LastLow:
Cardinal;

type
 TGetTickCount = class
 public
  class function GetTickCount64: UInt64; inline;
 end;

implementation

class function TGetTickCount.GetTickCount64: UInt64;
var
 Low: Cardinal;
begin
 if System.SysUtils.TOSVersion.Major >= 6 then // alles ab Windows Vista
  Result := Winapi.Windows.GetTickCount64
 else // alles vor Windows Vista
  begin
   Low := GetTickCount;
   if (LastLow > Low) then
    High := High + $0000000100000000;

   LastLow := Low;
   Result := High or Low;
  end;
end;

end.
  Mit Zitat antworten Zitat