Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter FiveGeneral Functions (continued)

5.16 Script Timing and Control

5.16.1 Overview

This section contains functions that help a script time operations or measure short durations of time as measured at the millisecond level. This differs from the Date and Time Functions which support date and time based on a clock and calendar.

5.16.2 Processing Time

One of the time bases for Legato is based on the Windows Tick Count which is built into the operating system as based on the computer’s hardware. The resolution of this function is limited to the resolution of the system timer, which is typically in the range of 10 milliseconds to 16 milliseconds.

The elapsed time is stored as a 32-bit value. Therefore, the time will wrap around to zero if the system is run continuously for 49.7 days. If required, a script should check for an overflow condition when comparing times.

When a script starts, the tick count is stored as a reference time count which can be reset on command. The elapsed time is the difference between the current time and the reference time.

5.16.3 Functions

Tick Count

GetElapsedTime — Gets the difference from the reference tick count to the current tick count in milliseconds.

GetLastActivityTick — Gets the last tick count for all user activities or a a class of activities.

GetTickCount — Gets the system tick count from the system start up.

ResetElapsedTime — Resets the elapsed time counter to the current system tick count.

Process Thread

Sleep — Sleeps for the specified number milliseconds.

Yield — Forces a yield of execution and allows any pending window messages to be processed with an option to force the frame window to update.