isPrime
that indicates for an integer whether it is a prime number.
IntStream
to count the prime numbers in a given range, and measure the time taken.
> java PrimeCounter 1 10000000 664579 prime numbers found in 4.859 seconds(The table on the Wikipedia page of the prime-counting function can be used to verify the results.)