aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/TimeMark.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/TimeMark.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/TimeMark.kt4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/TimeMark.kt b/src/main/java/at/hannibal2/skyhanni/utils/TimeMark.kt
index 83285550d..be5f59322 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/TimeMark.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/TimeMark.kt
@@ -3,14 +3,14 @@ package at.hannibal2.skyhanni.utils
import kotlin.time.Duration
import kotlin.time.Duration.Companion.milliseconds
-
data class TimeMark(val long: Long) {
fun hasNeverHappened() = long == 0L
fun passedTime() = if (long == 0L) Duration.Companion.INFINITE else (System.currentTimeMillis() - long).milliseconds
companion object {
+
fun never() = TimeMark(0)
fun now() = TimeMark(System.currentTimeMillis())
}
-} \ No newline at end of file
+}