code: public static void waitFor(double seconds) {
          long nanos = (long) (seconds * 1000000000);
          if (seconds > 0) {
              try {
                  TimeUnit.NANOSECONDS.sleep(nanos);
              } catch (InterruptedException ex) {
                  // Swallow exception
                  ex.printStackTrace();
              }
          }
      }
docs: /* Wait For