Skip to content

Commit 1e729da

Browse files
Fix measureNanoTimeAndPrintAndReturnResult() printing in seconds
1 parent f0933f2 commit 1e729da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/kotlin/KotlinFunctionLibrary.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ object KotlinFunctionLibrary{
137137
* */
138138
fun measureNanoTimeAndPrintWithoutReturningResult(
139139
inSeconds: Boolean = false,
140-
message: String = if (inSeconds) "Time to complete: %d seconds" else "Time to complete: %d nanoseconds",
140+
message: String = if (inSeconds) "Time to complete: %f seconds" else "Time to complete: %d nanoseconds",
141141
block: () -> Unit
142142
) {
143143
val timeToComplete = measureNanoTime(block)
@@ -153,7 +153,7 @@ object KotlinFunctionLibrary{
153153
* */
154154
fun <T> measureNanoTimeAndPrintAndReturnResult(
155155
inSeconds: Boolean = false,
156-
message: String = if (inSeconds) "Time to complete: %d seconds" else "Time to complete: %d nanoseconds",
156+
message: String = if (inSeconds) "Time to complete: %f seconds" else "Time to complete: %d nanoseconds",
157157
block: () -> T
158158
): T {
159159
var result: T

0 commit comments

Comments
 (0)