(Gast)
n/a Beiträge
|
Re: Beschränkung von GetTickCount umgehen
25. Okt 2004, 18:17
So besser?
Delphi-Quellcode:
var
QPF: Int64 = 0;
function GetTickCountEx: TUpTime;
begin
if QPF = 0 then
QueryPerformanceFrequency(QPF);
QueryPerformanceCounter(Ticks);
if (QPF = 0) or (Ticks = 0) then
begin
Result.Milliseconds := Word(-1);
Exit;
end;
Ticks := Ticks div QPF;
with Result do
begin
MilliSeconds := Ticks mod 1000;
Seconds := (Ticks div 1000) mod 60;
Minutes := (Ticks div 60000) mod 60;
Hours := (Ticks div 3600000) mod 24;
Days := ((Ticks div 3600000) div 24) mod 30;
Months := ((Ticks div 3600000) div 24) div 30;
Years := ((Ticks div 3600000) div 24) div 365;
end;
end;
|
|
Zitat
|