lsl_time_correction function

  1. @Native<NativeLsl_time_correction>()
double lsl_time_correction(
  1. lsl_inlet in$,
  2. double timeout,
  3. Pointer<Int32> ec
)

@brief Retrieve an estimated time correction offset for the given stream.

The first call to this function takes several milliseconds until a reliable first estimate is obtained. Subsequent calls are instantaneous (and rely on periodic background updates).

On a well-behaved network, the precision of these estimates should be below 1 ms (empirically it is within +/-0.2 ms).

To get a measure of whether the network is well-behaved, use #lsl_time_correction_ex and check uncertainty (which maps to round-trip-time). 0.2 ms is typical of wired networks.

2 ms is typical of wireless networks. The number can be much higher on poor networks.

@param in The lsl_inlet object to act on. @param timeout Timeout to acquire the first time-correction estimate. Use LSL_FOREVER to defuse the timeout. @paramout ec Error code: if nonzero, can be either #lsl_timeout_error (if the timeout has expired) or lsl_lost_error (if the stream source has been lost). @return The time correction estimate. This is the number that needs to be added to a time stamp that was remotely generated via lsl_local_clock() to map it into the local clock domain of this machine.

Implementation

@ffi.Native<NativeLsl_time_correction>()
external double lsl_time_correction(
  lsl_inlet in$,
  double timeout,
  ffi.Pointer<ffi.Int32> ec,
);