getCurrentMonotonicTimeInMs

Gets the current Monotonic Time of the SDK.

Future<int> getCurrentMonotonicTimeInMs();

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).

Call timing

This method can be called either before or after joining the channel.

Restrictions

None.

Returns

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