Created
July 4, 2020 03:47
-
-
Save yangweigbh/6252c03a499a640967c1b6301d3fa3e1 to your computer and use it in GitHub Desktop.
This file contains 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 getState(): BenchmarkState { | |
// Note: this is an explicit method instead of an accessor to help convey it's only for Java | |
// Kotlin users should call the [measureRepeated] method. | |
if (!applied) { | |
throw IllegalStateException( | |
"Cannot get state before BenchmarkRule is applied to a test. Check that your " + | |
"BenchmarkRule is annotated correctly (@Rule in Java, @get:Rule in Kotlin)." | |
) | |
} | |
return internalState | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment