harness.core.DurationOps.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of harness-core_sjs1_3 Show documentation
Show all versions of harness-core_sjs1_3 Show documentation
Miscellaneous libraries/utilities for Scala.
The newest version!
package harness.core
extension (self: java.time.Duration) {
def prettyPrint: String = {
val millis = self.toMillis
if (millis < 1000) s"$millis.${((self.toNanos % 1000000) / 1000).toString.alignRight(3, '0')}ms"
else s"${(millis / 1000).toStringCommas}.${(millis % 1000).toString.alignRight(3, '0')}s"
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy