INNER CODE UNIT · Java
qtds35k/HighFrequencyTradingBot · src/trading/HttpHelper.java:410
private static void print(String msg, Object... args) {
System.out.print(String.format(msg, args));
}
// sleeps for some time that is centered at input argument with randomized decimal amplitude
private static void randomSleep(int sec) throws InterruptedException {
int random_sec = (int) (sec * 1000 + Math.random() * 300 - 150);
// let's make it 0.5 sec shorter
if (random_sec > 500) random_sec -= 500;
Thread.sleep(random_sec);
}
}