Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有调度程序每 2 分钟运行一次。但我不能2m30s习惯。请帮帮我
2m30s
SchedulingPattern pattern = new SchedulingPattern("*/2 * * * *");
您可以在 SchedulingPattern 启动后等待 30 秒。
Scheduler scheduler = new Scheduler(); scheduler.schedule("*/2 * * * *", new Runnable() { @Override public void run() { Thread.sleep(30*1000); foo(); } };); schedule.start();