procedure TForm1.BitBtn1Click(Sender: TObject);
var
vTick : Cardinal;
vHours : Integer;
vMinutes : Integer;
vSeconds : Integer;
vMiliSecs: Integer;
vTime : string;
begin
vTick := GetTickCount;
vHours := vTick div (3600*1000); // extract the elapsed hours
vMinutes := (vTick mod (3600*1000)) div (60*1000); // extract the minutes
vSeconds := (vTick mod (60*1000)) div 1000; // extract the seconds
vMiliSecs:= vTick mod 1000; // extract the milliseconds
// format that values into more readable format
vTime := Format('%d:%d:%d.%d', [vHours, vMinutes, vSeconds, vMiliSecs]);
// show the info in a dialog
ShowMessage(vTime);
end;
Will show some dialog like this:
[ATTACH]3613[/ATTACH]


Sign In
Create Account



Back to top









