guru.z3.temple.toolkit.concurrent.WorkerUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of temple.toolkit Show documentation
Show all versions of temple.toolkit Show documentation
z3 guru base library. Alias name is temple.toolkit
package guru.z3.temple.toolkit.concurrent;
public class WorkerUtils
{
/**
* {@link Thread#interrupt()} 발생과 상관없이 일정한 시간동안 sleep상태를 유지한다
* @param tm
*/
public static void fixedSleep(long tm)
{
long t1 = System.currentTimeMillis();
long t2 = tm;
do
{
try { Thread.sleep(t2); } catch(InterruptedException e) { }
t2 = tm - (System.currentTimeMillis() - t1);
} while( t2 > 1 );
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy