Agora RTC Objective-C API Reference  Refactor
Public Member Functions
NtpTime Class Reference

Public Member Functions

uint64_t Ms () const
 
bool Valid () const
 
uint32_t ToSeconds () const
 
uint32_t ToFractions () const
 
uint64_t ToTimestamp () const
 

Constructor & Destructor Documentation

◆ NtpTime() [1/3]

NtpTime ( )
inline

◆ NtpTime() [2/3]

NtpTime ( uint64_t  ms)
inline

◆ NtpTime() [3/3]

NtpTime ( uint32_t  seconds,
uint32_t  fractions 
)
inline

Member Function Documentation

◆ operator uint64_t()

operator uint64_t ( ) const
inline

◆ Ms()

uint64_t Ms ( ) const
inline

Gets the NTP time.

Returns
  • The wallclock time which is in milliseconds relative to 0h UTC on 1 January 1900.

◆ Valid()

bool Valid ( ) const
inline

Check that whether the NtpTime object is valid

  • true: the NtpTime object is valid.
  • false: the NtpTime object is invalid.

◆ ToSeconds()

uint32_t ToSeconds ( ) const
inline

Gets the integer part of the NTP timestamp.

Returns
  • An uint32_t value.

◆ ToFractions()

uint32_t ToFractions ( ) const
inline

Gets the fractional part of the NTP timestamp.

Returns
  • An uint32_t value.

◆ ToTimestamp()

uint64_t ToTimestamp ( ) const
inline

Gets the NTP timestamp.

Note
  • The full resolution NTP timestamp is a 64-bit unsigned fixed-point number with the integer part in the first 32 bits and the fractional part in the last 32 bits.
Returns
  • An uint64_t value.

Field Documentation

◆ ntpFracPerSecond

const uint64_t ntpFracPerSecond = 4294967296
static

◆ ms_

uint64_t ms_
private