I would like to record how long it takes my JUnit test to run programmatically. I have a large number of tests in various test classes, and I would like to find out how long ea
Try to use @Before and @After. A method annotated with @Before or @After runs before or after the test.
@Before public void start() { start = System.currentTimeMillis(); } @After public void end() { System.out.println(System.currentTimeMillis() - start); }