aboutsummaryrefslogtreecommitdiffstats
path: root/kotlinx-coroutines-core/jvm/test/scheduling/TestTimeSource.kt
blob: a5c83d329ac4019e4fc74e6a13e907aec6dd6187 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*
 * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
 */

package kotlinx.coroutines.scheduling


internal class TestTimeSource(var time: Long) : TimeSource() {

    override fun nanoTime() = time

    fun step(delta: Long = WORK_STEALING_TIME_RESOLUTION_NS) {
        time += delta
    }
}