This question already has an answer here:
How can I benchmark java reflection methods properly? When I run this the results are very random and inconsistent with the methods Im running it on.
long start = System.currentTimeMillis();
for (int j = 0; j < 1000000; j++) {
method.invoke(instance, null);
}
System.out.println(System.currentTimeMillis() - start);
Aucun commentaire:
Enregistrer un commentaire