set lts [new LTS]
logical_time = system_time * speed + offsetThe LTS object uses a reference logical-to-system mapping to convert between logical and system time:
logical_time = (system_time - ref_system) * speed + ref_logical system_time = (logical_time - ref_logical) / speed + ref_systemWe borrowed the concept and terminology of the LTS from the Contiuous Media Toolkit.
1. set s [$lts speed]
or 2. $lts speed $s
Set or query the speed of the LTS object. s is a floating point number that represents the LTS speed. A speed of 0.0 means that the LTS has been stalled; a speed of 1.0 means that the LTS is moving at the same rate as system time. By default the speed is set to 0.0.
Returns: In syntax (1), it returns the current speed of the LTS. In syntax (2), the return value is undefined. now_logical:
1. set now [$lts now_logical]
or 2. $lts now_logical $now
With syntax (1), it returns a floating point number that represents the current logical time. Syntax (2) is used to configure the reference point used by the LTS object. The internal data structures are modified so that the logical time now and the current system time are used as the new reference point.
Returns: In syntax (1), it returns the current logical time of the LTS. In syntax (2), the return value is undefined. now_system:
set now [$lts now_system]Returns the current system time (the value returned by
gettimeofday()) as a floating point number (seconds.microseconds).
Returns: A floating point number representing the current system time. set_reference:
$lts set_reference $logical $systemSet the LTS reference point so that logical time
logical maps to system time system.
Returns: Nothing