可以用线程来做,每隔几秒开一个线程代码如下 public void runTask() { final long timeInterval = 120000;// 两分钟运行一次 final ThreadService threadService = new ThreadService(); Runnable runnable = new Runnable() { public void run() { while (true) { // ------- code for task to run…
HTML5标准规定 setTimeout的最短时间间隔是4毫秒: setInterval的最短间隔时间是10毫秒,也就是说,小于10毫秒的时间间隔会被调整到10毫秒 书和MDC 在John Resig的新书<Javascript忍者的秘密>一书中提到 Browsers all have a 10ms minimum delay on OSX and a(approximately) 15ms delay on Windows.在苹果机上的最小时间间隔是10毫秒, 在Windows系统上的最小时…