Skip to content

Instantly share code, notes, and snippets.

@npryce
Last active October 31, 2018 09:46
Show Gist options
  • Save npryce/b06242b70e5d9d4b30cc9dd569ef4787 to your computer and use it in GitHub Desktop.
Save npryce/b06242b70e5d9d4b30cc9dd569ef4787 to your computer and use it in GitHub Desktop.
minutest-hooks
fun TestContext<*>.withTestTiming() {
var start: Long? = null
before {
start = System.currentTimeMillis()
}
after {
start?.let {
val timeTaken = System.currentTimeMillis() - it
println("Test took ${timeTaken}ms")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment