Hoanghun5
12/14/2019, 11:12 AM@BenchmarkMode(Mode.AverageTime)
@Fork(2)
@Measurement(iterations = 10)
class MyBenchmark {
@Benchmark
fun testMethod(): Any {
val list: List<Int> = ArrayList()
for (i in 0 until NR_TO_INSERT) {
list.add(list.size / 2, i)
}
return list
}
companion object {
private const val NR_TO_INSERT = 500000
}
}
Hanno
12/15/2019, 7:58 AMJames Richardson
12/15/2019, 11:14 AMHoanghun5
12/16/2019, 4:19 PM