-
- All Implemented Interfaces:
-
java.lang.Comparable
@ApiStatus.Internal() public class TimeSpan implements Comparable<TimeSpan>
A measurement for time critical components on a macro (ms) level. Based on to ensure linear time progression (as opposed to a syncable clock). To provide real world unix time information, the start uptime time is stored alongside the unix time. The stop unix time is artificial, it gets projected based on the start time + duration of the time span.
-
-
Field Summary
Fields Modifier and Type Field Description private Stringdescriptionprivate longstartUnixTimeMsprivate longstartUptimeMs
-
Method Summary
Modifier and Type Method Description StringgetDescription()voidsetDescription(@Nullable() String description)voidsetStartUnixTimeMs(long startUnixTimeMs)longgetStartUptimeMs()voidsetup(@Nullable() String description, long startUnixTimeMs, long startUptimeMs, long stopUptimeMs)voidstart()Start the time span voidsetStartedAt(long uptimeMs)voidstop()Stops the time span voidsetStoppedAt(long uptimeMs)booleanhasStarted()booleanhasNotStarted()booleanhasStopped()booleanhasNotStopped()longgetStartTimestampMs()SentryDategetStartTimestamp()doublegetStartTimestampSecs()longgetProjectedStopTimestampMs()doublegetProjectedStopTimestampSecs()SentryDategetProjectedStopTimestamp()longgetDurationMs()voidreset()intcompareTo(@NotNull() TimeSpan o)-
-
Method Detail
-
getDescription
@Nullable() String getDescription()
-
setDescription
void setDescription(@Nullable() String description)
-
setStartUnixTimeMs
@TestOnly() void setStartUnixTimeMs(long startUnixTimeMs)
-
getStartUptimeMs
long getStartUptimeMs()
-
setup
void setup(@Nullable() String description, long startUnixTimeMs, long startUptimeMs, long stopUptimeMs)
-
start
void start()
Start the time span
-
setStartedAt
void setStartedAt(long uptimeMs)
- Parameters:
uptimeMs- the uptime in ms, provided by uptimeMillis
-
stop
void stop()
Stops the time span
-
setStoppedAt
void setStoppedAt(long uptimeMs)
- Parameters:
uptimeMs- the uptime in ms, provided by uptimeMillis
-
hasStarted
boolean hasStarted()
-
hasNotStarted
boolean hasNotStarted()
-
hasStopped
boolean hasStopped()
-
hasNotStopped
boolean hasNotStopped()
-
getStartTimestampMs
long getStartTimestampMs()
-
getStartTimestamp
@Nullable() SentryDate getStartTimestamp()
-
getStartTimestampSecs
double getStartTimestampSecs()
-
getProjectedStopTimestampMs
long getProjectedStopTimestampMs()
-
getProjectedStopTimestampSecs
double getProjectedStopTimestampSecs()
-
getProjectedStopTimestamp
@Nullable() SentryDate getProjectedStopTimestamp()
-
getDurationMs
long getDurationMs()
-
reset
void reset()
-
-
-
-