How to measure the a time-span in seconds using System.currentTimeMillis()?
I don't understand this code. I keep getting an error on the sceond line of code. Im having problems with the "counter". Is there a class or do I need an import for java.
long start = System.nanoTime();
counter.countPrimes(1000000);
final long end = System.nanoTime();
System.out.println("Took: " + ((end - start) / 1000000) + "ms");
System.out.println("Took: " + (end - start)/ 1000000000 + " seconds");