[ 
https://issues.apache.org/jira/browse/FLINK-4421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16097851#comment-16097851
 ] 

mingleizhang commented on FLINK-4421:
-------------------------------------

We already have {{System.nanoTime}} for measuring with a monitonous time. Why 
do we still introduce a Clock  that provides a currentTimeMillis() function 
calls {{System.currentTimeMillis()}} ? I think the two are equivalent since 
remembers the max returned timestamp so far and that way it would never return 
decreasing timestamps.

> Make clocks and time measurements monotonous
> --------------------------------------------
>
>                 Key: FLINK-4421
>                 URL: https://issues.apache.org/jira/browse/FLINK-4421
>             Project: Flink
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Stephan Ewen
>            Priority: Minor
>
> Currently, many places use {{System.currentTimeMillis()}} to acquire 
> timestamps or measure time intervals.
> Since this relies on the system clock, and the system clock is not 
> necessarily monotonous (in the presence of clock updates), this can lead to 
> negative duration and decreasing timestamps where increasing timestamps are 
> expected.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to