Articron Posted March 4, 2015 Posted March 4, 2015 (edited) The way a conditional sleep functions is amongst these lines : public boolean conditionalSleep(Condition c, long timeout) { Timer t = new Timer(timeout); while ((t.isRunning()) && (!c.validate())) { sleep(20); } c.validate(); return c.validate(); } Condition being following interface: public interface Condition { public boolean validate(); } Excuse the shit indentation :p Edited March 4, 2015 by Articron 1
Joseph Posted March 5, 2015 Posted March 5, 2015 The way a conditional sleep functions is amongst these lines : public boolean conditionalSleep(Condition c, long timeout) { Timer t = new Timer(timeout); while ((t.isRunning()) && (!c.validate())) { sleep(20); } c.validate(); return c.validate(); } Condition being following interface: public interface Condition { public boolean validate(); } Excuse the shit indentation nice to see you back 1
Tom Posted March 5, 2015 Posted March 5, 2015 The world needs more people like you James, people that aren't afraid to express their opinions, and certainly don't treat everything like they are competing for the world title.
Articron Posted March 5, 2015 Posted March 5, 2015 nice to see you back Just a driveby post man, just a driveby 1
VladBots Posted March 5, 2015 Posted March 5, 2015 c.validate(); return c.validate(); nice but da wut 1