Check this link . There may be useful information for you. And here that you are asking. And here is what you are looking for (just like the code below).
var hours: word; minutes: word; seconds: word; milliseconds: word; procedure StartClock; begin GetTime(hours, minutes, seconds, milliseconds); end; procedure StopClock; var seconds_count : longint; c_hours: word; c_minutes: word; c_seconds: word; c_milliseconds: word; begin GetTime(c_hours, c_minutes, c_seconds, c_milliseconds); seconds_count := c_seconds - seconds + (c_minutes - minutes) * 60 + (c_hours - hours) * 3600; writeln(inttostr(seconds_count) + ' seconds'); end; begin StartClock; // code you want to measure StopClock; end.
user532231
source share