Here you can find the source of sleepPeriod(double period)
public static void sleepPeriod(double period)
//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); } } }