Java Sleep sleepNs(int ns)

Here you can find the source of sleepNs(int ns)

Description

sleep Ns

License

Apache License

Declaration

public static void sleepNs(int ns) 

Method Source Code

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

public class Main {
    public static void sleepNs(int ns) {
        long start = System.nanoTime();
        long end = 0;

        do {/*from  w  ww . j  ava  2 s  .  com*/
            end = System.nanoTime();
        } while (start + ns >= end);
    }
}

Related

  1. sleepNanos(long nanoseconds)
  2. sleepNoException(int ms)
  3. sleepNoShit(long nanos)
  4. sleepNotException(long millis)
  5. sleepNoThrow(long timeoutMs)
  6. sleepNS(long ns)
  7. sleepOrCry(long timeToWait)
  8. sleepPeriod(double period)
  9. sleepQuietly(int millis)