Java 类org.openjdk.jmh.annotations.Timeout 实例源码

项目:incubator-rya    文件:QueryBenchmark.java   
@Benchmark
@BenchmarkMode(Mode.SingleShotTime)
@Timeout(time = 1, timeUnit = TimeUnit.HOURS)
public void queryRya() throws MalformedQueryException, QueryEvaluationException, SailException, NotEnoughResultsException {
    final QueryBenchmarkRun benchmark;

    if(numReads.equals( READ_ALL )) {
        benchmark = new QueryBenchmarkRun(sailConn, sparql);
    } else {
        benchmark = new QueryBenchmarkRun(sailConn, sparql, Long.parseLong(numReads));
    }

    benchmark.run();
}
项目:jmh    文件:MethodGroup.java   
public Optional<TimeValue> getTimeout() {
    Timeout ann = getFinal(Timeout.class);
    if (ann != null) {
        return Optional.of(new TimeValue(ann.time(), ann.timeUnit()));
    }
    return Optional.none();
}