feature #10: log Query

This commit is contained in:
2019-07-18 00:02:26 +02:00
parent 32127b7e19
commit a32b70c316
9 changed files with 79 additions and 54 deletions

View File

@@ -0,0 +1,8 @@
package fr.postgresjson.stopwatch
fun <T> elapse(callback: (start: Long) -> T, after: (elapse: Long) -> Unit): T {
val start = System.currentTimeMillis()
val result = callback(start)
after(System.currentTimeMillis() - start)
return result
}