下面列出了怎么用org.openjdk.jmh.annotations.State的API类实例代码及写法,或者点击链接到github查看源代码。
@Benchmark
@BenchmarkMode({Mode.Throughput, Mode.AverageTime, Mode.SampleTime, Mode.SingleShotTime})
@OutputTimeUnit(TimeUnit.NANOSECONDS)
public Object annotationPresent() {
return this.getClass().isAnnotationPresent(State.class);
}