Simplify Clock/ClockMark design
- Do not require initialElapsed parameter - Introduce instead ClockMark +- Duration operators - Do not require ClockMark to expose its originating Clock back - Turn elapsedFrom property into elapsed() function - Rename abstract clock classes - Fix unit of abstract clocks when constructing them Add top-level docs for Clocks
This commit is contained in:
@@ -5,8 +5,7 @@
|
||||
|
||||
package kotlin.time
|
||||
|
||||
public actual object MonoClock : LongReadingClock(), Clock { // TODO: interface should not be required here
|
||||
override fun reading(): Long = System.nanoTime()
|
||||
public actual object MonoClock : AbstractLongClock(unit = DurationUnit.NANOSECONDS), Clock { // TODO: interface should not be required here
|
||||
override fun read(): Long = System.nanoTime()
|
||||
override fun toString(): String = "Clock(System.nanoTime())"
|
||||
override val unit: DurationUnit = DurationUnit.NANOSECONDS
|
||||
}
|
||||
Reference in New Issue
Block a user