ilya.gorbunov
06/06/2019, 1:36 PMjw
06/06/2019, 1:42 PMilya.gorbunov
06/06/2019, 1:43 PMMarc Knaup
06/06/2019, 3:06 PMjava.time
, isn't it?serebit
06/06/2019, 6:16 PMMarc Knaup
06/06/2019, 6:18 PMserebit
06/06/2019, 6:18 PMbut we don’t currently plan to have full blown date-time (with time-zones, etc) for stdlib (too heavy).
serebit
06/06/2019, 6:18 PMfor stdlib
serebit
06/06/2019, 6:18 PMserebit
06/06/2019, 6:19 PMMarc Knaup
06/06/2019, 6:20 PMMarc Knaup
06/06/2019, 6:23 PMserebit
06/06/2019, 6:26 PMspand
06/07/2019, 7:56 AMTimedValue
really needed if this gets merged? https://youtrack.jetbrains.com/issue/KT-27856LeoColman
06/07/2019, 4:15 PMLeoColman
06/07/2019, 4:15 PM(...)e.g. 1.5.minutes, 30.seconds, 500.milliseconds. Otherwise the extension function numericValue.toDuration(unit) can be used.
LeoColman
06/07/2019, 4:15 PMLeoColman
06/07/2019, 4:16 PMilya.gorbunov
06/07/2019, 4:24 PMkotlin.time
package, which isn't imported by default.ilya.gorbunov
06/07/2019, 4:28 PMmeasureTime
has contract, still val (result, elapsed) = measureTimedValue { ... }
is more convenient than
val result: SomeType
val elapsed = measureTime { result = .... }
LeoColman
06/07/2019, 4:38 PMilya.gorbunov
06/07/2019, 4:40 PMLeoColman
06/07/2019, 4:41 PMMarc Knaup
06/07/2019, 4:46 PM1.milliseconds
is okay but for variables it won't show up 🙂
val errors = 1
errors.milliseconds // nope, not possible
jw
06/07/2019, 4:47 PMilya.gorbunov
06/07/2019, 4:53 PMu
suffix.Marc Knaup
06/07/2019, 4:54 PM1ms
custom suffixes (at some point in the future)?
Or 1.unsigned
😂
suffix fun <http://Int.ms|Int.ms>() = Milliseconds(this)
suffix fun Int.u() = UInt(this)