Java Sleep sleepPeriod(double period)

Here you can find the source of sleepPeriod(double period)

Description

sleep Period

License

LGPL

Declaration

public static void sleepPeriod(double period) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    public static void sleepPeriod(double period) {
        try {/*from   ww w .j  av  a  2s . co  m*/
            long millis = (long) (period * 1000);
            int nanos = (int) ((period * 1000 - millis) * 1000000);
            Thread.sleep(millis, nanos);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}

Related

  1. sleepNotException(long millis)
  2. sleepNoThrow(long timeoutMs)
  3. sleepNs(int ns)
  4. sleepNS(long ns)
  5. sleepOrCry(long timeToWait)
  6. sleepQuietly(int millis)
  7. sleepQuietly(long millis)
  8. sleepQuietly(long millis)
  9. sleepQuietly(long ms)