diff --git a/src/main/kotlin/com/beust/kobalt/Main.kt b/src/main/kotlin/com/beust/kobalt/Main.kt index 65ca6490..c8e974b3 100644 --- a/src/main/kotlin/com/beust/kobalt/Main.kt +++ b/src/main/kotlin/com/beust/kobalt/Main.kt @@ -93,7 +93,7 @@ private class Main @Inject constructor( var result = 0 val latestVersionFuture = github.latestKobaltVersion - val seconds = benchmark("build", { + val seconds = benchmark { try { result = runWithArgs(jc, args, argv) } catch(ex: KobaltException) { @@ -102,7 +102,7 @@ private class Main @Inject constructor( } finally { executors.shutdown() } - }) + } log(1, if (result != 0) "BUILD FAILED: $result" else "BUILD SUCCESSFUL ($seconds seconds)") diff --git a/src/main/kotlin/com/beust/kobalt/misc/Benchmarks.kt b/src/main/kotlin/com/beust/kobalt/misc/Benchmarks.kt index 41661136..70378e2f 100644 --- a/src/main/kotlin/com/beust/kobalt/misc/Benchmarks.kt +++ b/src/main/kotlin/com/beust/kobalt/misc/Benchmarks.kt @@ -1,6 +1,6 @@ package com.beust.kobalt.misc -public fun benchmark(message: String, run: () -> Unit) : Long { +public fun benchmark(run: () -> Unit) : Long { val start = System.currentTimeMillis() run() return (System.currentTimeMillis() - start) / 1000