cron

Creator: coderz1093

Last updated:

Add to Cart

Description:

cron

Cron #
Run tasks periodically at fixed times or intervals.

Usage #
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');
});
}
copied to clipboard
Cron parser #
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
}
copied to clipboard
Links #

source code
contributors: Agilord

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.