cron 0.6.1 cron: ^0.6.1 copied to clipboard
A time-based job scheduler similar to cron. Run tasks periodically at fixed times or intervals.
import 'package:cron/cron.dart';
Future<void> main() async {
final cron = Cron();
try {
cron.schedule(Schedule.parse('*/6 * * * * *'), () {
print(DateTime.now());
});
await Future.delayed(Duration(seconds: 20));
await cron.close();
} on ScheduleParseException {
// "ScheduleParseException" is thrown if cron parsing is failed.
await cron.close();
}
}