diff --git a/org.ntlab.reverseDebugger/src/org/ntlab/debuggingControl/SpeedTester.java b/org.ntlab.reverseDebugger/src/org/ntlab/debuggingControl/SpeedTester.java index 9c80b8f..4c63c6b 100644 --- a/org.ntlab.reverseDebugger/src/org/ntlab/debuggingControl/SpeedTester.java +++ b/org.ntlab.reverseDebugger/src/org/ntlab/debuggingControl/SpeedTester.java @@ -42,19 +42,21 @@ private void test(MethodCaller mc, ObjectReference roots, String targetSignature, SpeedTestType type, final int LOOP) throws InvalidTypeException, ClassNotLoadedException, InvocationException, IncompatibleThreadStateException { int count = 0; - long beforeTime, afterTime, executionTime, sumTime = 0, bestTime = -1, worstTime = -1; + long beforeTime = 0, afterTime = 0, executionTime, sumTime = 0, bestTime = -1, worstTime = -1; for (int i = 0; i < LOOP; i++) { mc.setObj(roots); - beforeTime = System.nanoTime(); switch (type) { case REVERSE_DEBUGGER: + beforeTime = System.nanoTime(); count = countMethodExecutionInReverseDebugger(mc, targetSignature, 0, "--------"); + afterTime = System.nanoTime(); break; case TRACE_COLLECTOR: + beforeTime = System.nanoTime(); count = countMethodExecutionInTraceCollector(mc, targetSignature, 0, "--------"); + afterTime = System.nanoTime(); break; } - afterTime = System.nanoTime(); executionTime = afterTime - beforeTime; System.out.print("count: " + count + " "); System.out.println(String.format("Time%-2d: %10d nsec", (i + 1), executionTime));