diff --git a/core/src/main/scala/time.scala b/core/src/main/scala/time.scala index cdade89..63b5d6e 100644 --- a/core/src/main/scala/time.scala +++ b/core/src/main/scala/time.scala @@ -98,12 +98,17 @@ object time: inline def nowDateTime: LocalDateTime = LocalDateTime.now(utc_) inline def nowInstant: Instant = Instant.now() - inline def nowNanos: Long = System.nanoTime() inline def nowMillis: Long = System.currentTimeMillis() inline def nowCentis: Long = nowMillis / 10L inline def nowTenths: Long = nowMillis / 100L inline def nowSeconds: Int = (nowMillis / 1000L).toInt // Guaranteed to not overflow until 2038 + /** Relative to some arbitrary point in time. + * + * Useful only in comparisons to self, such as measuring time intervals. + */ + inline def nowNanosRel: Long = System.nanoTime() + def instantOf(year: Int, month: Int, dayOfMonth: Int, hour: Int, minute: Int) = java.time.LocalDateTime.of(year, month, dayOfMonth, hour, minute).instant