diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/pi/DistSum.java b/hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/pi/DistSum.java index ffe63feba0..9fb666544b 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/pi/DistSum.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/pi/DistSum.java @@ -51,6 +51,7 @@ import org.apache.hadoop.mapreduce.TaskInputOutputContext; import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; import org.apache.hadoop.net.NetUtils; +import org.apache.hadoop.util.Time; import org.apache.hadoop.util.Tool; import org.apache.hadoop.util.ToolRunner; import org.slf4j.Logger; @@ -162,9 +163,9 @@ static void compute(Summation sigma, LOG.info(s = "sigma=" + sigma); context.setStatus(s); - final long start = System.currentTimeMillis(); + final long start = Time.monotonicNow(); sigma.compute(); - final long duration = System.currentTimeMillis() - start; + final long duration = Time.monotonicNow() - start; final TaskResult result = new TaskResult(sigma, duration); LOG.info(s = "result=" + result);