[junit 5] JUnit5TestExecutionListener: use System#nanoTime for duration computation

GitOrigin-RevId: fbfee40c2884c93493ed723a7100ac535ce8ab11
This commit is contained in:
Vladislav Rassokhin
2023-07-28 12:49:33 +00:00
committed by intellij-monorepo-bot
parent 49b5521ccd
commit 2278d05ac4
@@ -138,7 +138,7 @@ public class JUnit5TestExecutionListener implements TestExecutionListener {
public void executionStarted(TestIdentifier testIdentifier) {
if (testIdentifier.isTest()) {
testStarted(testIdentifier);
myCurrentTestStart = System.currentTimeMillis();
myCurrentTestStart = System.nanoTime();
}
else if (!shouldSkipContainer(testIdentifier)) {
myFinishCount = 0;
@@ -216,7 +216,7 @@ public class JUnit5TestExecutionListener implements TestExecutionListener {
}
protected long getDuration() {
return System.currentTimeMillis() - myCurrentTestStart;
return (System.nanoTime() - myCurrentTestStart) / 1_000_000;
}
private void testStarted(TestIdentifier testIdentifier) {