Here you can find the source of sleepNs(int ns)
public static void sleepNs(int ns)
//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); } }