provides timed callbacks using Java threads
var def={ sleepTime:delay, hasSlept:false, run:function(){ if(!this.hasSlept){ this.hasSlept=true; java.lang.Thread.currentThread().sleep(this.sleepTime); } try{ func(); }catch(e){ console.debug("Error running setTimeout thread:" + e); } } }; var runnable = new java.lang.Runnable(def); var thread = new java.lang.Thread(runnable); thread.start(); return dojo._timeouts.push(thread)-1;