1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 16:28:12 -07:00

Added --profiling.

This commit is contained in:
Cedric Beust 2016-07-24 22:39:43 -08:00
parent f8d2d0ed23
commit 888e5cde73
3 changed files with 17 additions and 5 deletions

View file

@ -213,7 +213,14 @@ private class Main @Inject constructor(
// Shutdown all plug-ins
plugins.shutdownPlugins()
log(3, "Timings:\n " + runTargetResult.messages.joinToString("\n "))
if (args.profiling) {
log(1, "\nTIMINGS (SECONDS)")
log(1, "================\n")
runTargetResult.timings.sortedByDescending { it.durationMillis }.forEach {
log(1, String.format("%.2f", it.durationMillis.toDouble() / 1000) + " " + it.taskName)
}
log(1, "\n")
}
}
}
}