Skip to content

Instantly share code, notes, and snippets.

View MarcinMoskala's full-sized avatar

Marcin Moskała MarcinMoskala

View GitHub Profile
@streetsofboston
streetsofboston / TestCoroutineContext.kt
Last active May 28, 2018 11:42
Kotlin Unit Tests Util for having testable functions using Coroutines: TestCoroutineContext
@file:Suppress("PackageDirectoryMismatch")
/*
* Copyright (c) 2018 Intrepid Pursuits,Inc. All rights reserved.
*/
package kotlinx.coroutines.experimental.intrepid
import kotlinx.coroutines.experimental.*
import java.util.concurrent.PriorityBlockingQueue
import java.util.concurrent.TimeUnit
@gildor
gildor / coroutine-delay.kt
Last active July 23, 2020 02:38
Proof of concept for Kotlin JS coroutines delay()
import kotlin.coroutines.experimental.*
import kotlin.js.Date
fun main(args: Array<String>) {
println("before launch")
launch {
println("hello: ${Date()}")
delay(3000)
println("bye: ${Date()}")
}