File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
commonMain/src/org/jetbrains/gradle/benchmarks
jvmMain/src/org/jetbrains/gradle/benchmarks/jvm Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -32,11 +32,11 @@ class RunnerConfiguration : CommandLineInterface("Client") {
32
32
).map { parseTimeUnit(it) }.store()
33
33
34
34
private fun parseTimeUnit (text : String ) = when (text) {
35
- BenchmarkTimeUnit .SECONDS .name, " s" -> BenchmarkTimeUnit .SECONDS
36
- BenchmarkTimeUnit .MICROSECONDS .name, " us" -> BenchmarkTimeUnit .MICROSECONDS
37
- BenchmarkTimeUnit .MILLISECONDS .name, " ms" -> BenchmarkTimeUnit .MILLISECONDS
38
- BenchmarkTimeUnit .NANOSECONDS .name, " ns" -> BenchmarkTimeUnit .NANOSECONDS
39
- BenchmarkTimeUnit .MINUTES .name, " m" -> BenchmarkTimeUnit .MINUTES
35
+ BenchmarkTimeUnit .SECONDS .name, " s" , " sec " -> BenchmarkTimeUnit .SECONDS
36
+ BenchmarkTimeUnit .MICROSECONDS .name, " us" , " micros " -> BenchmarkTimeUnit .MICROSECONDS
37
+ BenchmarkTimeUnit .MILLISECONDS .name, " ms" , " millis " -> BenchmarkTimeUnit .MILLISECONDS
38
+ BenchmarkTimeUnit .NANOSECONDS .name, " ns" , " nanos " -> BenchmarkTimeUnit .NANOSECONDS
39
+ BenchmarkTimeUnit .MINUTES .name, " m" , " min " -> BenchmarkTimeUnit .MINUTES
40
40
else -> throw UnsupportedOperationException (" Unknown time unit: $text " )
41
41
}
42
42
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import org.openjdk.jmh.runner.*
9
9
import org.openjdk.jmh.runner.format.*
10
10
import org.openjdk.jmh.runner.options.*
11
11
import java.io.*
12
+ import java.util.concurrent.*
12
13
13
14
fun main (args : Array <String >) {
14
15
val params = RunnerConfiguration ().also { it.parse(args) }
@@ -17,7 +18,7 @@ fun main(args: Array<String>) {
17
18
params.iterations?.let { jmhOptions.measurementIterations(it) }
18
19
params.warmups?.let { jmhOptions.warmupIterations(it) }
19
20
params.iterationTime?.let {
20
- val timeValue = TimeValue (it, params.iterationTimeUnit)
21
+ val timeValue = TimeValue (it, params.iterationTimeUnit ? : TimeUnit . SECONDS )
21
22
jmhOptions.warmupTime(timeValue)
22
23
jmhOptions.measurementTime(timeValue)
23
24
}
You can’t perform that action at this time.
0 commit comments