Skip to content

Instantly share code, notes, and snippets.

@vladdedita
Created November 21, 2024 23:18
Show Gist options
  • Save vladdedita/92b6bc6dc70f27238123d86deb96c955 to your computer and use it in GitHub Desktop.
Save vladdedita/92b6bc6dc70f27238123d86deb96c955 to your computer and use it in GitHub Desktop.
class ManuallyTimingTest {
private long startTime;
@BeforeEach
void startTimer() {
startTime = System.currentTimeMillis();
}
@AfterEach
void logDuration(TestInfo testInfo) {
long duration = System.currentTimeMillis() - startTime;
System.out.println(testInfo.getDisplayName() + " took " + duration + " ms");
}
@Test
void test() {
// Test logic
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment