initial commit
This commit is contained in:
22
Demo/Program.cs
Normal file
22
Demo/Program.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
|
||||
namespace Demo
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main()
|
||||
{
|
||||
var expression = "0-30/5 * * * * *";
|
||||
Console.WriteLine(expression);
|
||||
var timer = new CronTimer(expression, "Asia/Hong_Kong", includingSeconds: true);
|
||||
timer.OnOccurence += (s, ea) => Console.WriteLine($"{ea.At:T} - {DateTime.Now}");
|
||||
timer.Start();
|
||||
|
||||
while (Console.ReadKey().Key != ConsoleKey.Escape)
|
||||
{
|
||||
}
|
||||
|
||||
timer.Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user