code: public static long diffTimestamps(final int a, final int b) {
          // first convert each to unsigned integers
          final long unsignedA = a & 0xFFFFFFFFL;
          final long unsignedB = b & 0xFFFFFFFFL;
          // then find the delta
          final long delta = unsignedA - unsignedB;
          return delta;
      }
docs: Calculates the delta between two time stamps, adjusting for time stamp wrapping.
  
  @param a
  First time stamp
  @param b
  Second time stamp
  @return the distance between a and b, which will be negative if a is less than b.