All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.ruedigermoeller.fastcast.util.Sleeper Maven / Gradle / Ivy

There is a newer version: 3.10
Show newest version
package de.ruedigermoeller.fastcast.util;

/**
 * Created with IntelliJ IDEA.
 * User: moelrue
 * Date: 8/12/13
 * Time: 2:28 PM
 * To change this template use File | Settings | File Templates.
 */
public class Sleeper {

    int sleepcount = 0;
    public void sleepMicros(int micro) {
        if ( micro <= 0 )
            return;
        sleepcount+=micro;
        try {
            if ( sleepcount >= 1000 ) {
                Thread.sleep(sleepcount/1000);
                sleepcount%=1000;
            }
        } catch (InterruptedException e) {
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy