Package io.sentry
Class SentryDate
java.lang.Object
io.sentry.SentryDate
- All Implemented Interfaces:
Comparable<SentryDate>
- Direct Known Subclasses:
SentryInstantDate,SentryLongDate,SentryNanotimeDate
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(@NotNull SentryDate otherDate) longdiff(@NotNull SentryDate otherDate) Difference between two dates in nanoseconds.final booleanisAfter(@NotNull SentryDate otherDate) final booleanisBefore(@NotNull SentryDate otherDate) longlaterDateNanosTimestampByDiff(@Nullable SentryDate otherDate) Calculates a date by using another date.abstract longReturns the date in nanoseconds as long.
-
Constructor Details
-
SentryDate
public SentryDate()
-
-
Method Details
-
nanoTimestamp
public abstract long nanoTimestamp()Returns the date in nanoseconds as long. -
laterDateNanosTimestampByDiff
Calculates a date by using another date.This is a workaround for limited precision offered in some cases (e.g. when using
SentryNanotimeDate). This makes it possible to have high precision duration by using nanoseconds for the finish timestamp where normally the start and finish timestamps would only offer millisecond precision.- Parameters:
otherDate- anotherSentryDate- Returns:
- date in seconds as long
-
diff
Difference between two dates in nanoseconds.- Parameters:
otherDate- anotherSentryDate- Returns:
- difference in nanoseconds
-
isBefore
-
isAfter
-
compareTo
- Specified by:
compareToin interfaceComparable<SentryDate>
-