so, regarding some reasonably non-controversial wr...
# language-proposals
g
so, regarding some reasonably non-controversial wrapper work, (converting java methods such that their last argument is a functional one), is there any way we can push this work into
standard.kt
? eg, using a
ScheduledExecutorService
from kotlin:
Copy code
val executor = Executors.newSingleThreadScheduledExecutor()

executor.scheduleWithFixedDelay({ doWork(); }, 0, 50, TimeUnit.MILLISECONDS);
vs
Copy code
val executor = Executors.newSingleThreadScheduledExecutor()
executor.scheduleWithFixedDelay(<http://50.ms|50.ms>) {
  doWork();
}
with the simple adapter
Copy code
fun ScheduledExecutorService.scheduleWithFixedDelay(delay: Duration, job: () -> Unit)
        = scheduleWithFixedDelay(job, 0, delay.toNanos(), TimeUnit.NANOSECONDS)

//this one might be more controversial, but even with out it...
val <http://Int.ms|Int.ms>: Duration get() = Duration.ofMillis(this.toLong())