+ 3
why this program always different time for (for loop)
long start, end; System.out.println("Timing a for loop from 0 to 100,000,000"); // time a for loop from 0 to 100,000,000 start = System.currentTimeMillis(); for(long i=0; i < 100000000L; i++) ; end = System.currentTimeMillis(); System.out.println("Elapsed time: " + (end-start));
1 Réponse
+ 7
Because the speed of the compiler isn't always the same