title: How to get elapsed time for a Hadoop task on local mode?
body: <p>Hi I am trying to run the WordCount program with Hadoop in <strong>local/standalone</strong> mode and I want to see the time needed for the task. I'm using the code from the Hadoop website. I tried adding this at the end of the code but it prints out 0.</p>
  
  <pre><code>job.waitForCompletion(true);
  long time = job.getFinishTime() - job.getStartTime();
  System.out.println("Time taken = " + time);
  </code></pre>
  
  <p>I also tried this method but it prints out nothing instead.</p>
  
  <pre><code>job.waitForCompletion(); 
  
  TaskReport[] reports = job.getTaskReports(TaskType.MAP);
  for(TaskReport report : reports) { 
     long time = report.getFinishTime() - report.getStartTime();
     System.out.println(report.getTaskId() + " took " + time + " millis!");
  }
  </code></pre>
  
  <p>Is there another way to see the elapsed time in milliseconds in Hadoop standalone mode? Many thanks!</p>