If I am designing a test on sorting algorithm can I do this way to avoid JVM warmup ? Thank you!
double count = 0;
double start, end;
for(int r = 0; r < warmup; r++) {
// do test
}
for(int t = 0; t < runs; t++){
start = System.nanoTime();
// do test
end = System.nanoTime();
count += start - end;
}
double avg = count/avg
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…