You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/01/12 15:15:00 UTC

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

     [ https://issues.apache.org/jira/browse/HADOOP-17463?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ASF GitHub Bot updated HADOOP-17463:
------------------------------------
    Labels: pull-request-available  (was: )

> 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
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> 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: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org