// inside the listener for the WatchService final MyTimer t = new MyTimer(); // takes current time, initialized to 0 tasks for (Change c : allChanges) { t.incrementTaskCount(); // synchronized launchConcurrentProcess(c, t); } // inside your processor, after processing a change t.decrementTaskCount(); // also synchronized // inside MyTimer public void synchronized decrementTaskCount() { totalTasks --; // depending on your benchmarking needs, you can do different things here // I am printing max time only (= end of last), but min/max/avg may also be nice if (totalTasks == 0) { System.err.println("The time spent on this batch was " + System.currentTimeMillis() - initialTime); } }