Waktu Pemakaian Komputer

{$R *.dfm}
function Uptime : string;
const
tickperjam : integer =1000*60*60;
tickpermenit : integer =1000*60;
tickperdetik : integer = 1000;
var
t : longword;
d,h,m,s : integer;
begin

t:=GetTickCount;
h:=t div tickperjam;
dec (t,h*tickperjam);
m:=t div tickpermenit;
dec(t,m * tickpermenit);
s:=t div tickperdetik;
result:=IntToStr(h)+’jam’+IntToStr(m)+’menit dan’+IntToStr(s)+’detik’;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
label1.Caption:=’Komputer ini sudah berjalan selama :’+Uptime;
end;

end.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: