code: private void barrier() {
      long sleepTime;
      while ((sleepTime = startTime - System.currentTimeMillis()) > 0) {
        try {
          Thread.sleep(sleepTime);
        } catch (InterruptedException ex) {
        }
      }
    }
docs: Returns when the current number of seconds from the epoch equals
  the command line argument given by <code>-startTime</code>.
  This allows multiple instances of this program, running on clock
  synchronized nodes, to start at roughly the same time.