How to convert System.currentTimeMillis(); to seconds?
long start6=System.currentTimeMillis();
System.out.println(counter.countPrimes(100000000)
From your code it would appear that you are trying to measure how long a computation took (as opposed to trying to figure out what the current time is).
In that case, you need to call currentTimeMillis before and after the computation, take the difference, and divide the result by 1000 to convert milliseconds to seconds.