@@ -0,0 +1,775 @@
+package javasnack.snacks.jmh;%0A%0Aimport org.openjdk.jmh.annotations.Benchmark;%0Aimport org.openjdk.jmh.annotations.Scope;%0Aimport org.openjdk.jmh.annotations.State;%0A%0A/* copied from:%0A * https://hg.openjdk.java.net/code-tools/jmh/file/tip/jmh-samples/src/main/java/org/openjdk/jmh/samples/%0A * %0A * jmh args: JmhSamples01HelloWorld (-f %5Bforks%5D -i %5Biterations%5D -wi %5Bwarmup-iterations%5D...) %0A */%0A/*%0A * Fortunately, in many cases you just need a single state object.%0A * In that case, we can mark the benchmark instance itself to be%0A * the @State. Then, we can reference its own fields as any%0A * Java program does.%0A */%0A@State(Scope.Thread)%0Apublic class JmhSamples04DefaultState %7B%0A%0A    double someDouble = Math.PI;%0A%0A    @Benchmark%0A    public void measure() %7B%0A        someDouble++;%0A    %7D%0A%7D%0A

add JmhSamples04DefaultState