MCPcopy Index your code
hub / github.com/apache/groovy / main

Method main

benchmark/bench/sieve.java:5–25  ·  view source on GitHub ↗
(String args[])

Source from the content-addressed store, hash-verified

3
4public class sieve {
5 public static void main(String args[]) {
6 int NUM = Integer.parseInt(args[0]);
7 boolean [] flags = new boolean[8192 + 1];
8 int count = 0;
9 while (NUM-- > 0) {
10 count = 0;
11 for (int i=2; i <= 8192; i++) {
12 flags[i] = true;
13 }
14 for (int i=2; i <= 8192; i++) {
15 if (flags[i]) {
16 // remove all multiples of prime: i
17 for (int k=i+i; k <= 8192; k+=i) {
18 flags[k] = false;
19 }
20 count++;
21 }
22 }
23 }
24 System.out.print("Count: " + count + "\n");
25 }
26}
27

Callers

nothing calls this directly

Calls 2

parseIntMethod · 0.80
printMethod · 0.45

Tested by

no test coverage detected