Package 

Class TimestampUtils

  • All Implemented Interfaces:

    
    public class TimestampUtils
    
                        

    Helper class to perform various timestamp manipulations and comparisons

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static long subtractAsUnsignedInt32(long t1, long t2) Calculate the subtraction result of two long input as unsigned 32bit int.
      static boolean isNewerTimestamp(long t1, long t2) Returns true if t1 is newer than t2, taking into account rollover.
      static long latestTimestamp(long timestamp1, long timestamp2) webrtc/modules/include/module_common_types.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • subtractAsUnsignedInt32

         static long subtractAsUnsignedInt32(long t1, long t2)

        Calculate the subtraction result of two long input as unsigned 32bit int.

        Parameters:
        t1 - the first timestamp
        t2 - the second timestamp
      • isNewerTimestamp

         static boolean isNewerTimestamp(long t1, long t2)

        Returns true if t1 is newer than t2, taking into account rollover. This is done by effectively checking if the distance of going from 't2' to 't1' (strictly incrementing) is shorter or if going from 't1' to 't2' (i.e. rolling over) is shorter. webrtc/modules/include/module_common_types.h

      • latestTimestamp

         static long latestTimestamp(long timestamp1, long timestamp2)

        webrtc/modules/include/module_common_types.h