Skip to content

Commit

Permalink
Fix measureNanoTimeAndPrintAndReturnResult() printing in seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
Sternbach-Software committed Sep 9, 2021
1 parent f0933f2 commit 1e729da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/KotlinFunctionLibrary.kt
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ object KotlinFunctionLibrary{
* */
fun measureNanoTimeAndPrintWithoutReturningResult(
inSeconds: Boolean = false,
message: String = if (inSeconds) "Time to complete: %d seconds" else "Time to complete: %d nanoseconds",
message: String = if (inSeconds) "Time to complete: %f seconds" else "Time to complete: %d nanoseconds",
block: () -> Unit
) {
val timeToComplete = measureNanoTime(block)
Expand All @@ -153,7 +153,7 @@ object KotlinFunctionLibrary{
* */
fun <T> measureNanoTimeAndPrintAndReturnResult(
inSeconds: Boolean = false,
message: String = if (inSeconds) "Time to complete: %d seconds" else "Time to complete: %d nanoseconds",
message: String = if (inSeconds) "Time to complete: %f seconds" else "Time to complete: %d nanoseconds",
block: () -> T
): T {
var result: T
Expand Down

0 comments on commit 1e729da

Please sign in to comment.