X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;ds=sidebyside;f=Timer%2FSimulatedTimer.groovy;h=cf123be7992dcebbbd6c72c398670ed20d608dbe;hb=4f9a1209b0c1ca5caf60a0f811e18dde6a92e9e9;hp=a13376610f5f56f26341e4a6cb4f666332c25a2c;hpb=dcc0f887a11615f3c36b394215117719bb46aaf8;p=smartthings-infrastructure.git diff --git a/Timer/SimulatedTimer.groovy b/Timer/SimulatedTimer.groovy index a133766..cf123be 100644 --- a/Timer/SimulatedTimer.groovy +++ b/Timer/SimulatedTimer.groovy @@ -10,7 +10,7 @@ public class SimulatedTimer { //By Apps def runAfter(int delay, Closure closure) { - thread = new Thread() { + /*thread = new Thread() { @Override public void run() { @@ -18,11 +18,12 @@ public class SimulatedTimer { closure() } }.start() - return thread + return thread*/ + closure() } def cancel() { - if (thread != null) - thread.stop() + //if (thread != null) + // thread.stop() } }