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

Method chameneos

benchmark/bench/chameneos.java:107–126  ·  view source on GitHub ↗
(int n)

Source from the content-addressed store, hash-verified

105 }
106
107 public chameneos(int n) throws InterruptedException {
108 int meetings = 0;
109 mp = new MeetingPlace(n);
110
111 for (int i = 0; i < COLOURS.length; i++) {
112 creatures[i] = new Creature(COLOURS[i], mp);
113 creatures[i].start();
114 }
115
116 // wait for all threads to complete
117 for (int i = 0; i < COLOURS.length; i++)
118 creatures[i].join();
119
120 // sum all the meetings
121 for (int i = 0; i < COLOURS.length; i++) {
122 meetings += creatures[i].getCreaturesMet();
123 }
124
125 System.out.println(meetings);
126 }
127
128 public static void main(String[] args) throws Exception {
129 if (args.length < 1)

Callers

nothing calls this directly

Calls 4

getCreaturesMetMethod · 0.80
startMethod · 0.65
joinMethod · 0.45
printlnMethod · 0.45

Tested by

no test coverage detected