Package io.sentry
Class SentryDate
java.lang.Object
io.sentry.SentryDate
- All Implemented Interfaces:
Comparable<SentryDate>
- Direct Known Subclasses:
SentryInstantDate
,SentryLongDate
,SentryNanotimeDate
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(@NotNull SentryDate otherDate) long
diff
(@NotNull SentryDate otherDate) Difference between two dates in nanoseconds.final boolean
isAfter
(@NotNull SentryDate otherDate) final boolean
isBefore
(@NotNull SentryDate otherDate) long
laterDateNanosTimestampByDiff
(@Nullable SentryDate otherDate) Calculates a date by using another date.abstract long
Returns 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:
compareTo
in interfaceComparable<SentryDate>
-