getCurrentMonotonicTimeInMs

Gets the current Monotonic Time of the SDK.

public abstract long getCurrentMonotonicTimeInMs();

Details

Since
v4.2.0

Monotonic Time refers to a monotonically increasing time series whose value increases over time. The unit is milliseconds.

In custom video capture and custom audio capture scenarios, in order to ensure audio and video synchronization, Agora recommends that you call this method to obtain the current Monotonic Time of the SDK, and then pass this value into the timestamp parameter in the captured video frame (VideoFrame) and audio frame (AudioFrame).

Returns

  • ≥0: The method call is successful, and returns the current Monotonic Time of the SDK (in milliseconds).
  • < 0: Failure.