# HG changeset patch # User Doug Simon # Date 1379079554 -7200 # Node ID 103e4438bb19e837ad07c8a5e7bccfc32be22627 # Parent a0da0bff042e37dc35dee0d76839df9111910f8c added support for accumulative times to TimerImpl diff -r a0da0bff042e -r 103e4438bb19 graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/TimerImpl.java --- a/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/TimerImpl.java Fri Sep 13 15:21:51 2013 +0200 +++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/TimerImpl.java Fri Sep 13 15:39:14 2013 +0200 @@ -42,8 +42,17 @@ */ private static ThreadLocal currentTimer = new ThreadLocal<>(); + private final DebugValue flat; + public TimerImpl(String name, boolean conditional) { - super(name, conditional); + super(name + "_Accm", conditional); + this.flat = new DebugValue(name + "_Flat", conditional) { + + @Override + public String toString(long value) { + return valueToString(value); + } + }; } @Override @@ -98,7 +107,8 @@ } currentTimer.set(parent); long flatTime = timeSpan - nestedTimeToSubtract; - TimerImpl.this.addToCurrentValue(flatTime); + TimerImpl.this.addToCurrentValue(timeSpan); + flat.addToCurrentValue(flatTime); } protected abstract long currentTime();