Mercurial > hg > graal-compiler
annotate graal/com.oracle.graal.debug.test/src/com/oracle/graal/debug/test/DebugTimerTest.java @ 17351:ea7b8c7a6e5c
fixed reliability of DebugTimerTest
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 06 Oct 2014 17:32:55 +0200 |
parents | 95663a6385cf |
children | d044ca4a1cdc |
rev | line source |
---|---|
17174
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
1 /* |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2013, 2013, Oracle and/or its affiliates. All rights reserved. |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
4 * |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
8 * |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
14 * |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
18 * |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
21 * questions. |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
22 */ |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
23 package com.oracle.graal.debug.test; |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
24 |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
25 import static org.junit.Assert.*; |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
26 |
17351
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
27 import java.lang.management.*; |
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
28 |
17174
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
29 import org.junit.*; |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
30 |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
31 import com.oracle.graal.debug.*; |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
32 import com.oracle.graal.debug.internal.*; |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
33 |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
34 public class DebugTimerTest { |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
35 |
17351
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
36 private static final ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean(); |
17174
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
37 |
17351
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
38 /** |
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
39 * Actively spins the current thread for at least a given number of milliseconds in such a way |
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
40 * that timers for the current thread keep ticking over. |
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
41 * |
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
42 * @return the number of milliseconds actually spent spinning which is guaranteed to be >= |
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
43 * {@code ms} |
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
44 */ |
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
45 private static long spin(long ms) { |
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
46 long start = threadMXBean.getCurrentThreadCpuTime(); |
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
47 do { |
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
48 long durationMS = (threadMXBean.getCurrentThreadCpuTime() - start) / 1000; |
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
49 if (durationMS >= ms) { |
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
50 return durationMS; |
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
51 } |
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
52 } while (true); |
17350
95663a6385cf
DebugTimerTest: ignore on windows for now
Bernhard Urban <bernhard.urban@jku.at>
parents:
17174
diff
changeset
|
53 } |
95663a6385cf
DebugTimerTest: ignore on windows for now
Bernhard Urban <bernhard.urban@jku.at>
parents:
17174
diff
changeset
|
54 |
17174
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
55 @Test |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
56 public void test1() { |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
57 DebugConfig debugConfig = Debug.fixedConfig(0, 0, false, false, true, false, null, null, System.out); |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
58 try (DebugConfigScope dcs = new DebugConfigScope(debugConfig); Debug.Scope s = Debug.scope("DebugTimerTest")) { |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
59 |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
60 DebugTimer timerA = Debug.timer("TimerA"); |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
61 DebugTimer timerB = Debug.timer("TimerB"); |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
62 |
17351
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
63 long spinA; |
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
64 long spinB; |
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
65 |
17174
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
66 try (TimerCloseable a1 = timerA.start()) { |
17351
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
67 spinA = spin(50); |
17174
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
68 try (TimerCloseable b1 = timerB.start()) { |
17351
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
69 spinB = spin(50); |
17174
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
70 } |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
71 } |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
72 |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
73 Assert.assertTrue(timerB.getCurrentValue() < timerA.getCurrentValue()); |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
74 if (timerA.getFlat() != null && timerB.getFlat() != null) { |
17351
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
75 assertTrue(spinB >= spinA || timerB.getFlat().getCurrentValue() < timerA.getFlat().getCurrentValue()); |
17174
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
76 assertEquals(timerA.getFlat().getCurrentValue(), timerA.getCurrentValue() - timerB.getFlat().getCurrentValue(), 10D); |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
77 } |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
78 } |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
79 } |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
80 |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
81 @Test |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
82 public void test2() { |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
83 DebugConfig debugConfig = Debug.fixedConfig(0, 0, false, false, true, false, null, null, System.out); |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
84 try (DebugConfigScope dcs = new DebugConfigScope(debugConfig); Debug.Scope s = Debug.scope("DebugTimerTest")) { |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
85 DebugTimer timerC = Debug.timer("TimerC"); |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
86 try (TimerCloseable c1 = timerC.start()) { |
17351
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
87 spin(50); |
17174
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
88 try (TimerCloseable c2 = timerC.start()) { |
17351
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
89 spin(50); |
17174
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
90 try (TimerCloseable c3 = timerC.start()) { |
17351
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
91 spin(50); |
17174
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
92 try (TimerCloseable c4 = timerC.start()) { |
17351
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
93 spin(50); |
17174
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
94 try (TimerCloseable c5 = timerC.start()) { |
17351
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
95 spin(50); |
17174
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
96 } |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
97 } |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
98 } |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
99 } |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
100 } |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
101 if (timerC.getFlat() != null) { |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
102 assertEquals(timerC.getFlat().getCurrentValue(), timerC.getCurrentValue()); |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
103 } |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
104 } |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
105 } |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
106 |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
107 @Test |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
108 public void test3() { |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
109 DebugConfig debugConfig = Debug.fixedConfig(0, 0, false, false, true, false, null, null, System.out); |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
110 try (DebugConfigScope dcs = new DebugConfigScope(debugConfig); Debug.Scope s = Debug.scope("DebugTimerTest")) { |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
111 |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
112 DebugTimer timerD = Debug.timer("TimerD"); |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
113 DebugTimer timerE = Debug.timer("TimerE"); |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
114 |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
115 try (TimerCloseable d1 = timerD.start()) { |
17351
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
116 spin(50); |
17174
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
117 try (TimerCloseable e1 = timerE.start()) { |
17351
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
118 spin(50); |
17174
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
119 try (TimerCloseable d2 = timerD.start()) { |
17351
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
120 spin(50); |
17174
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
121 try (TimerCloseable d3 = timerD.start()) { |
17351
ea7b8c7a6e5c
fixed reliability of DebugTimerTest
Doug Simon <doug.simon@oracle.com>
parents:
17350
diff
changeset
|
122 spin(50); |
17174
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
123 } |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
124 } |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
125 } |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
126 } |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
127 |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
128 Assert.assertTrue(timerE.getCurrentValue() < timerD.getCurrentValue()); |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
129 if (timerD.getFlat() != null && timerE.getFlat() != null) { |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
130 assertTrue(timerE.getFlat().getCurrentValue() < timerD.getFlat().getCurrentValue()); |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
131 assertEquals(timerD.getFlat().getCurrentValue(), timerD.getCurrentValue() - timerE.getFlat().getCurrentValue(), 10D); |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
132 } |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
133 } |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
134 } |
2cb007e99ed0
added support for getting the flat time from a DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
135 } |