aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt
index 4d7b7ad4d..201c294e5 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt
@@ -163,3 +163,8 @@ enum class TimeUnit(val factor: Long, val shortName: String, val longName: Strin
fun format(value: Int, longFormat: Boolean = false) = value.addSeparators() + getName(value, longFormat)
}
+
+val Duration.inPartialSeconds: Double get() = inWholeMilliseconds.toDouble() / 1000
+val Duration.inPartialMinutes: Double get() = inPartialSeconds / 60
+val Duration.inPartialHours: Double get() = inPartialSeconds / 3600
+val Duration.inPartialDays: Double get() = inPartialSeconds / 86_400