code: public synchronized long delay() {
          while (true) {
              long curTimeMs = System.currentTimeMillis();
              long millisSinceLastSecond = curTimeMs % 1000;
              long nowInMsRoundedAtSec = curTimeMs - millisSinceLastSecond;
              checkNextSecond(nowInMsRoundedAtSec);
              int delayMs = getDelay(millisSinceLastSecond);
  
              if (stopping) {
                  delayMs = delayMs > 0 ? 10 : 0;
                  notify(); // NOSONAR Don't notifyAll as cost is too big in terms of performances
              }
  
              if (delayMs < 1) {
                  notify(); // NOSONAR Don't notifyAll as cost is too big in terms of performances
                  break;
              }
              cntDelayed++;
              try {
                  wait(delayMs);
              } catch (InterruptedException ex) {
                  log.debug("Waiting thread was interrupted", ex);
                  Thread.currentThread().interrupt();
              }
              cntDelayed--;
          }
          cntSent++;
          return 0;
      }
docs: Internally handles that delay for caller thread
  
  @return 0