code: public static long waitTillNextTick(long currentTick, long tickSize) {
          long nextBlock = System.currentTimeMillis() / tickSize;
          for (; nextBlock <= currentTick; nextBlock = System.currentTimeMillis() / tickSize) {
              Thread.yield();
          }
          return nextBlock;
      }
docs: Waits till clock moves to the next tick.
  
  @param currentTick
  @param tickSize
  tick size in milliseconds
  @return the "next" tick