src/org/nutz/lang/Tasks.java
public static void scheduleAtFixedTime(final Runnable task, Date startTime) {
        final Timer timer = new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                taskScheduler.execute(task);
                timer.cancel();
                timerList.remove(timer);
            }
        }, startTime);
        timerList.add(timer);
    }
public static void scheduleAtFixedTime(final Runnable task, Date startTime) {
        final Timer timer = new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                taskScheduler.execute(task);
                timer.cancel();
                timerList.remove(timer);
            }
        }, startTime);
        timerList.add(timer);
    }
public static void scheduleAtFixedTime ( final Runnable task , Date startTime ) { final Timer timer = new Timer ( ) ; timer . schedule ( new TimerTask ( ) { @ Override public void run ( ) { taskScheduler . execute ( task ) ; timer . cancel ( ) ; timerList . remove ( timer ) ; } } , startTime ) ; timerList . add ( timer ) ; }
在指定的时间点启动任务只运行一次
@param task 具体待执行的任务
@param startTime 运行的时间点
在指定的时间点启动任务只运行一次