[jira] [Created] (HADOOP-17463) Replace currentTimeMillis with monotonicNow in elapsed time

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (HADOOP-17463) Replace currentTimeMillis with monotonicNow in elapsed time

Steve Loughran (Jira)
Ahmed Hussein created HADOOP-17463:
--------------------------------------

             Summary: Replace currentTimeMillis with monotonicNow in elapsed time
                 Key: HADOOP-17463
                 URL: https://issues.apache.org/jira/browse/HADOOP-17463
             Project: Hadoop Common
          Issue Type: Bug
            Reporter: Ahmed Hussein
            Assignee: Ahmed Hussein


I noticed that there is a widespread incorrect usage of {{System.currentTimeMillis()}}  throughout the hadoop code.

For example:

{code:java}
// Some comments here
long start = System.currentTimeMillis();
while (System.currentTimeMillis() - start < timeout) {
  // Do something
}
{code}

Elapsed time should be measured using `monotonicNow()`.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]