You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/03/02 12:52:05 UTC

[GitHub] [pulsar] racorn opened a new issue #6453: Pulsar Java client: Use System.nanoTime() instead of System.currentTimeMillis() to measure elapsed time

racorn opened a new issue #6453: Pulsar Java client: Use System.nanoTime() instead of System.currentTimeMillis() to measure elapsed time
URL: https://github.com/apache/pulsar/issues/6453
 
 
   **Describe the bug**
   
   More an improvement than a bug, but
   
   `ConsumerBase` and `ProducerImpl` use `System.currentTimeMillis()` to measure the elapsed time in the 'operations' inner classes (`ConsumerBase$OpBatchReceive` and `ProducerImpl$OpSendMsg`).
   
   An instance variable `createdAt` is initialized with `System.currentTimeMills()`, but it is not used for reading wall clock time, the variable is only used for computing elapsed time (e.g. timeout for a batch).
   
   When the variable is used to compute elapsed time, it would more sense to use `System.nanoTime()`.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] sijie closed issue #6453: Pulsar Java client: Use System.nanoTime() instead of System.currentTimeMillis() to measure elapsed time

Posted by GitBox <gi...@apache.org>.
sijie closed issue #6453: Pulsar Java client: Use System.nanoTime() instead of System.currentTimeMillis() to measure elapsed time
URL: https://github.com/apache/pulsar/issues/6453
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services