I'm not sure if this is relevant here (since I didn't test anything), but shouldn't be the calculation of hours like this?:
> h := r mod 24; r := r div 24;
ZOPPO
function GetPerformanceCounterTick: Int64;
var PCount: Int64;
begin;
if QueryPerformanceCounter(PCount) then Result := PCount
else raise exception.create('QueryPerformanceCounter Error');
end;
function GetTimerFrequency: Int64;
var Frequency: Int64;
begin
if QueryPerformanceFrequency(Frequency) then Result := Frequency
else raise exception.create('QueryPerformanceFrequency Error');
end;
function SystemUptime:string;
var f, t : int64;
r, d, h, m, s : word;
begin;
f := GetTimerFrequency;
t := GetPerformanceCounterTick;
r := t div f; // in seconds
s := r mod 60; r := r div 60;
m := r mod 60; r := r div 60;
h := r mod 60; r := r div 24;
d := r;
if d >0 then result := Format('%3d Days %2d Hours %2d Minutes %2d Seconds', [d, h, m, s])
else if h > 0 then result := Format('%2d Hours %2d Minutes %2d Seconds', [h, m, s])
else if m > 0 then result := Format('%2d Minutes %2d Seconds', [m, s])
else result := Format('%2d Seconds', [s])
end;
Title | # Comments | Views | Activity |
---|---|---|---|
How to convert MFC::CString to UTF8 wchar_t* | 10 | 92 | |
Magic Software info | 18 | 100 | |
Exception thrown at 0x00007FFD5BC81F28 | 7 | 30 | |
Which Linux flavors will this run on? | 6 | 29 |
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
9 Experts available now in Live!