Mercurial > hg > truffle
comparison graal/com.oracle.graal.debug/src/com/oracle/graal/debug/DebugTimer.java @ 15581:0dc0926cf0d8
added -G:TrackMemUse for measuring memory usage within scopes
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 09 May 2014 17:59:15 +0200 |
parents | c125485642e2 |
children | 2cb007e99ed0 |
comparison
equal
deleted
inserted
replaced
15580:ce201bb843b4 | 15581:0dc0926cf0d8 |
---|---|
27 import com.oracle.graal.debug.internal.*; | 27 import com.oracle.graal.debug.internal.*; |
28 | 28 |
29 /** | 29 /** |
30 * A timer for some activity of interest. A timer should be deployed using the try-with-resources | 30 * A timer for some activity of interest. A timer should be deployed using the try-with-resources |
31 * pattern: | 31 * pattern: |
32 * | 32 * |
33 * <pre> | 33 * <pre> |
34 * try (TimerCloseable a = timer.start()) { | 34 * try (TimerCloseable a = timer.start()) { |
35 * // the code to time | 35 * // the code to time |
36 * } | 36 * } |
37 * </pre> | 37 * </pre> |
39 public interface DebugTimer { | 39 public interface DebugTimer { |
40 | 40 |
41 /** | 41 /** |
42 * Starts this timer if timing is {@linkplain Debug#isTimeEnabled() enabled} or this is an | 42 * Starts this timer if timing is {@linkplain Debug#isTimeEnabled() enabled} or this is an |
43 * {@linkplain #isConditional() unconditional} timer. | 43 * {@linkplain #isConditional() unconditional} timer. |
44 * | 44 * |
45 * @return an object that must be closed once the activity has completed to add the elapsed time | 45 * @return an object that must be closed once the activity has completed to add the elapsed time |
46 * since this call to the total for this timer | 46 * since this call to the total for this timer |
47 */ | 47 */ |
48 TimerCloseable start(); | 48 TimerCloseable start(); |
49 | 49 |
50 /** | 50 /** |
51 * Sets a flag determining if this timer is only enabled if metering is | 51 * Sets a flag determining if this timer is only enabled if timing is |
52 * {@link Debug#isMeterEnabled() enabled}. | 52 * {@link Debug#isTimeEnabled() enabled}. |
53 */ | 53 */ |
54 void setConditional(boolean flag); | 54 void setConditional(boolean flag); |
55 | 55 |
56 /** | 56 /** |
57 * Determines if this timer is only enabled if metering is {@link Debug#isMeterEnabled() | 57 * Determines if this timer is only enabled if timing is {@link Debug#isTimeEnabled() enabled}. |
58 * enabled}. | |
59 */ | 58 */ |
60 boolean isConditional(); | 59 boolean isConditional(); |
61 | 60 |
62 /** | 61 /** |
63 * Gets the current value of this timer. | 62 * Gets the current value of this timer. |