de.ruedigermoeller.fastcast.util.Sleeper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fast-cast Show documentation
Show all versions of fast-cast Show documentation
a fast brokerless messaging library based on reliable UDP multicast
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