v0.6.2
cron
類似於 cron 的時間基礎工作排程器。定期在固定時間或間隔執行任務。
595喜歡 5.6萬近 30 天下載160Pub 分數
AndroidiOSWebmacOSWindowsLinux
用於 Dart 的類似 cron 的基於時間的任務排程器
^1.1.1^5.0.0^1.25.0^1.3.1以下為英文專案原文快照,最新內容請造訪 GitHub。
Run tasks periodically at fixed times or intervals.
A simple usage example:
import 'package:cron/cron.dart';
void main() {
final cron = Cron();
cron.schedule(Schedule.parse('*/3 * * * *'), () async {
print('every three minutes');
});
cron.schedule(Schedule.parse('8-11 * * * *'), () async {
print('between every 8 and 11 minutes');
});
}
You can easily create and parse cron format:
import 'package:cron/cron.dart';
void main() {
print(Schedule.parse('3-5 * * * *').minutes); // [3, 4, 5]
print(Schedule(hours: 12, minutes: 25, weekdays: [2, 3])
.toCronString()); // 25 12 * * 2,3
}