Util.GetDurationString

Top  Previous  Next

 

Syntax

function Util.GetDurationString(Hours: positive-integer; Minutes: positive-integer; Seconds: positive-integer; Milliseconds: positive-integer): string

 

Description

Formats a string for the given duration with its value Hours, Minutes, Seconds and Milliseconds.

 

The Return Value is the duration formatted as hh:mm:ss.ms, eg: "02:10:02.346"

 

See Also

Util.GetTickCount
Util.GetTickDiff
Util.DecodeTicks

 

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