//This procedure tells how long your PC have been running.
//NOTE: After 49.7 days windows starts over to zero in keeping track
//on how long its been running.
procedure TForm1.Button1Click(Sender: TObject);
const
cDay= 86400000;
cHour=3600000;
cMin = 60000;
cSec = 1000;
var
iTick:dword;
idays,iHour,iMin,iSec,iMil: integer;
sHold:string;
begin
iTick:=gettickCount;
idays:= iTick div cDay; //calculates days
iHour:= (iTick mod cDay) div cHour; //calculates Hours
iMin:= ((iTick mod cDay) mod cHour) div cMin; //calculates minutes
iSec:=(((iTick mod cDay) mod cHour) mod cMin) div cSec; //calculates Seconds
iMil:=(((iTick mod cDay) mod cHour) mod cMin) mod cSec; //calculates Milliseconds
sHold:= 'This PC has been running for '+intTostr(iDays)+' Days, ';
sHold:=sHold+IntTostr(iHour)+' Hours, ';
sHold:=sHold+IntTostr(iMin)+' Minutes, ';
sHold:=sHold+IntTostr(iSec)+' Seconds, ';
sHold:=sHold+IntTostr(iMil)+' Mil Sec. ';
showmessage(sHold);
end;