0

我似乎无法从这里开始。我拉下代码并自己构建了卡尺,这解决了我的第一组问题,但现在我遇到了需要微型仪器的错误

这个实验需要一个微基准。定时器的粒度(535ns)大于测量运行时间(331.0μs)的0.1%。使用微基准仪器进行准确测量。

那么,如何设置微型仪器呢?

我在要运行的方法之前使用@Benchmark,在我的主要内部看起来像这样:

CaliperMain.main(
    MyClass.class,
    new String[]{ "-i", "runtime" }
);

我尝试将运行时更改为“微”,但这没有用。有任何想法吗?

4

1 回答 1

0

我想,你只需要使用

@Benchmark int time(int reps) {
    // repeat reps times what you want to measure
}

代替

@Benchmark int time() {
}
于 2014-10-21T23:47:55.543 回答