Skip to main content
Version: 21 Aug 2024

MLTime

NameSpace: MagicLeap

Represents an ML API wide timestamp in nanoseconds that is not guaranteed to be synced with any system time. If OpenXR is used, MLTime is synonymous with the XrTime type. More...

Detailed Description

public class MLTime; 

Details*

API for converting between system and runtime clock timestamps.


Public Fields

Value


public long Value { get; set; }


Public Methods

MLResult ConvertMLTimeToSystemTime

Converts timestamps from MLTime to system time. System time is equivalent to the system's monotonic clock. This can be used to calculate duration between two MLTime values by converting them both to a timespec and subtracting the subsequent values.

public static MLResult ConvertMLTimeToSystemTime(
MLTime mlTime,
out long timestampNs
)

Parameters

TypeNameDescription
MLTimemlTimeRepresents an ML API wide timestamp in nanoseconds that is not guaranteed to be synced with any system time. If OpenXR is used, MLTime is synonymous with the XrTime type.
out longtimestampNs

MLResult ConvertSystemTimeToMLTime

Converts timestamps from system time to MLTime. System time is equivalent to the system's monotonic clock.

public static MLResult ConvertSystemTimeToMLTime(
long timestampNs,
out MLTime mlTime
)

Parameters

TypeNameDescription
longtimestampNs
out MLTimemlTimeRepresents an ML API wide timestamp in nanoseconds that is not guaranteed to be synced with any system time. If OpenXR is used, MLTime is synonymous with the XrTime type.

override string ToString

public override string ToString()

implicit operator MLTime

public static implicit operator MLTime(
long timestamp
)

Parameters

TypeNameDescription
longtimestamp

implicit operator long

public static implicit operator long(
MLTime mltime
)

Parameters

TypeNameDescription
MLTimemltimeRepresents an ML API wide timestamp in nanoseconds that is not guaranteed to be synced with any system time. If OpenXR is used, MLTime is synonymous with the XrTime type.