docs: public void waitWhileRunning(long ms) {
  
          int i = 0;
          // wait until it is done or time is over
          synchronized (this) {
              try {
                  Thread.sleep(100); // wait a bit to give the publish engine the chance to actualize the state
              } catch (InterruptedException e) {
                  // ignore
                  e.printStackTrace();
              }
              while (isRunning() && ((MS_ONE_SECOND * i) <= ms)) {
                  try {
                      Thread.sleep(MS_ONE_SECOND); // wait a second
                  } catch (InterruptedException e) {
                      // ignore
                      e.printStackTrace();
                  }
                  i++;
              }
          }
      }