mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 16:28:12 -07:00
Millis and seconds.
This commit is contained in:
parent
941e254cca
commit
f4e04e138c
1 changed files with 6 additions and 2 deletions
|
@ -1,8 +1,12 @@
|
|||
package com.beust.kobalt.misc
|
||||
|
||||
public fun benchmark(run: () -> Unit) : Long {
|
||||
fun benchmarkMillis(run: () -> Unit) : Long {
|
||||
val start = System.currentTimeMillis()
|
||||
run()
|
||||
return (System.currentTimeMillis() - start) / 1000
|
||||
return System.currentTimeMillis() - start
|
||||
}
|
||||
|
||||
fun benchmarkSeconds(run: () -> Unit) = benchmarkMillis(run) / 1000
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue