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 2021/09/14 06:05:26 UTC

[GitHub] [pulsar] 315157973 commented on a change in pull request #12016: [testclient] Add new option --num-messages for consumer and reader

315157973 commented on a change in pull request #12016:
URL: https://github.com/apache/pulsar/pull/12016#discussion_r707937881



##########
File path: pulsar-testclient/src/main/java/org/apache/pulsar/testclient/ManagedLedgerWriter.java
##########
@@ -240,7 +238,8 @@ public void run() {
 
                     // Acquire 1 sec worth of messages to have a slower ramp-up
                     rateLimiter.acquire((int) msgRate);
-                    final long startTime = System.currentTimeMillis();
+                    final long startTime = System.nanoTime();
+                    final long testEndTime = startTime + (long) (arguments.testTime * 1e9);

Review comment:
       I recommend using `TimeUnit.SECONDS.toNanos()` instead of `1e9` to make it more understandable to other developers




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org