Github user clebertsuconic commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1586#discussion_r144593753
  
    --- Diff: 
artemis-commons/src/test/java/org/apache/activemq/artemis/utils/ActiveMQScheduledComponentTest.java
 ---
    @@ -165,4 +165,37 @@ public void run() {
           }
        }
     
    +   @Test
    +   public void testUsingCustomInitialDelay() throws InterruptedException {
    +      final CountDownLatch latch = new CountDownLatch(1);
    +      final long initialDelayMillis = 100;
    +      final long checkPeriodMillis = 100 * initialDelayMillis;
    +      final ActiveMQScheduledComponent local = new 
ActiveMQScheduledComponent(scheduledExecutorService, executorService, 
initialDelayMillis, checkPeriodMillis, TimeUnit.MILLISECONDS, false) {
    +         @Override
    +         public void run() {
    +            latch.countDown();
    +         }
    +      };
    +      final long start = System.nanoTime();
    +      local.start();
    +      try {
    +         final boolean triggeredBeforePeriod = 
latch.await(local.getPeriod(), local.getTimeUnit());
    +         final long timeToFirstTrigger = 
TimeUnit.NANOSECONDS.convert(System.nanoTime() - start, local.getTimeUnit());
    --- End diff --
    
    where you need NANOSECONDS? scheduling at nanosecond may kill perf.. where 
is it? 


---

Reply via email to