aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Marks <pmarks@virtuslab.com>2020-04-09 13:27:30 +0200
committerPaweł Marks <pmarks@virtuslab.com>2020-04-09 13:27:30 +0200
commitbc843d67b455e484cd05cdf28e5ce5dec68119d4 (patch)
treea97d178bdb487da42d632ad86268327043d55fc4
parent83ba2aa4a885bf9ab07ca0402fb8bcf1ca1547ad (diff)
downloaddokka-bc843d67b455e484cd05cdf28e5ce5dec68119d4.tar.gz
dokka-bc843d67b455e484cd05cdf28e5ce5dec68119d4.tar.bz2
dokka-bc843d67b455e484cd05cdf28e5ce5dec68119d4.zip
Fix improper reporting of time measurement
-rw-r--r--core/src/main/kotlin/DokkaGenerator.kt6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/src/main/kotlin/DokkaGenerator.kt b/core/src/main/kotlin/DokkaGenerator.kt
index 72161322..9616b013 100644
--- a/core/src/main/kotlin/DokkaGenerator.kt
+++ b/core/src/main/kotlin/DokkaGenerator.kt
@@ -201,10 +201,12 @@ private class Timer(startTime: Long, private val logger: DokkaLogger?) {
val namePad = steps.map { it.first.length }.max() ?: 0
val timePad = steps.windowed(2).map { (p1, p2) -> p2.second - p1.second }.max()?.toString()?.length ?: 0
steps.windowed(2).forEach { (p1, p2) ->
- println("${p2.first.padStart(namePad)}: ${(p2.second - p1.second).toString().padStart(timePad)}")
+ if (p1.first.isNotBlank()) {
+ println("${p1.first.padStart(namePad)}: ${(p2.second - p1.second).toString().padStart(timePad)}")
+ }
}
}
}
private fun timed(logger: DokkaLogger? = null, block: Timer.() -> Unit): Timer =
- Timer(System.currentTimeMillis(), logger).apply(block) \ No newline at end of file
+ Timer(System.currentTimeMillis(), logger).apply(block).apply { report("") } \ No newline at end of file