changeset 291:46e1bd39ea2e

Extend BenchmarkModes sample with BenchmarkMode.All.
author shade
date Mon, 02 Dec 2013 19:52:42 +0400
parents 0d6830555eac
children e2f2ef7a7f7b
files jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_02_BenchmarkModes.java
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_02_BenchmarkModes.java	Mon Dec 02 19:48:05 2013 +0400
+++ b/jmh-samples/src/main/java/org/openjdk/jmh/samples/JMHSample_02_BenchmarkModes.java	Mon Dec 02 19:52:42 2013 +0400
@@ -114,6 +114,17 @@
     @GenerateMicroBenchmark
     @BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SampleTime, Mode.SingleShotTime})
     @OutputTimeUnit(TimeUnit.MICROSECONDS)
+    public void measureMultiple() throws InterruptedException {
+        TimeUnit.MILLISECONDS.sleep(100);
+    }
+
+    /*
+     * Or even...
+     */
+
+    @GenerateMicroBenchmark
+    @BenchmarkMode(Mode.All)
+    @OutputTimeUnit(TimeUnit.MICROSECONDS)
     public void measureAll() throws InterruptedException {
         TimeUnit.MILLISECONDS.sleep(100);
     }