Last active
October 31, 2018 09:46
-
-
Save npryce/b06242b70e5d9d4b30cc9dd569ef4787 to your computer and use it in GitHub Desktop.
minutest-hooks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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