Salve ragazzi sono nuovo su questo forum vorrei avere un parere da voi se è possibile e se si come fare a diminuire il tempo che impiega questa operazione.
codice:
public class tempoprocesso {
public static void main(String[] args) {
long start = System.nanoTime();
System.out.println("Start: " + start);
int totalEven = 0;
for (int i = 0; i < 10000; i++) {
if (i % 2 == 0) {
totalEven = totalEven + i;
}
}
long end = System.nanoTime();
System.out.println("Fine : " + end);
long elapsedTime = end - start;
System.out.println("La durata del processo: "
+ elapsedTime + " nano secondi");
}
}