Util.GetTickDiff |
Top Previous Next |
Syntax function Util.GetTickDiff(OldTicks: positive-integer; [NewTicks: positive-integer]): positive-integer
Description Calculates the difference between the provides values. If no NewTicks is provided, the routine uses the current tick count as the new value.
The Return Value is the result of NewTicks - OldTicks.
See Also
Example execute UDSBlock as begin /* retrieves the number of milliseconds that have elapsed since the system was started, up to 49.7 days. */ StartTicks = Util.GetTickCount();
GUI.Showmessage('This computer has been running for ' || Util.GetTicksDurationString(StartTicks));
EndTicks = Util.GetTickCount();
DiffTicks = Util.GetTickDiff(StartTicks, EndTicks);
DiffTicks2 = Util.GetTickDiff(StartTicks);
h = 0; n = 0; s = 0; ms = 0; Util.DecodeTicks(DiffTicks, h, n, s, ms);
duration_str = Util.GetDurationString(h, n, s, ms);
GUI.ShowMessage('Script started at ' || StartTicks || ', ended after ' || DiffTicks || ' milliseconds, that''s a duration of ' || duration_str); end |