Package io.opencensus.common
Class TimeUtils
java.lang.Object
io.opencensus.common.TimeUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final BigInteger
(package private) static final int
(package private) static final long
(package private) static final long
private static final BigInteger
(package private) static final long
(package private) static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static long
checkedAdd
(long x, long y) Adds two longs and throws anArithmeticException
if the result overflows.(package private) static int
compareLongs
(long x, long y) Compares two longs.
-
Field Details
-
MAX_SECONDS
static final long MAX_SECONDS- See Also:
-
MAX_NANOS
static final int MAX_NANOS- See Also:
-
MILLIS_PER_SECOND
static final long MILLIS_PER_SECOND- See Also:
-
NANOS_PER_MILLI
static final long NANOS_PER_MILLI- See Also:
-
NANOS_PER_SECOND
static final long NANOS_PER_SECOND- See Also:
-
MAX_LONG_VALUE
-
MIN_LONG_VALUE
-
-
Constructor Details
-
TimeUtils
private TimeUtils()
-
-
Method Details
-
compareLongs
static int compareLongs(long x, long y) Compares two longs. This functionality is provided byLong.compare(long, long)
in Java 7. -
checkedAdd
static long checkedAdd(long x, long y) Adds two longs and throws anArithmeticException
if the result overflows. This functionality is provided byMath.addExact(long, long)
in Java 8.
-