package com.uchuhimo.volatilePattern;

import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Mode;

public class YDependBenchmark {
  @Benchmark
  @BenchmarkMode(Mode.Throughput)
  public void testOnce() {
    new YDepend().testOnce();
  }

  @Benchmark
  @BenchmarkMode(Mode.Throughput)
  public void testAtLeastOnce() {
    new YDepend().testAtLeastOnce();
  }
}

package com.uchuhimo.volatilePattern;

import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;

import java.util.concurrent.TimeUnit;

@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public class YDependBenchmark {
  @Benchmark
  public void testOnce() {
    new YDepend().testOnce();
  }

  @Benchmark
  public void testAtLeastOnce() {
    new YDepend().testAtLeastOnce();
  }
}

define jmh annotation on class