Chronograph 1.0.4
dotnet add package Chronograph --version 1.0.4
NuGet\Install-Package Chronograph -Version 1.0.4
<PackageReference Include="Chronograph" Version="1.0.4" />
<PackageVersion Include="Chronograph" Version="1.0.4" />
<PackageReference Include="Chronograph" />
paket add Chronograph --version 1.0.4
#r "nuget: Chronograph, 1.0.4"
#:package Chronograph@1.0.4
#addin nuget:?package=Chronograph&version=1.0.4
#tool nuget:?package=Chronograph&version=1.0.4
Chronograph.TaskScheduler allows to execute method at a specified time and at regular intervals.
There are following Periodic: Second Minute Hour Day Week Month Year Monday Tuesday Wednesday Thursday Friday Saturday Sunday
How to use:
This code demonstrates how to use the Chronograph.TaskScheduler class to schedule and run the Boom method defined in the Boo class.
static void Main() { var boo = new Boo(); var cts = new CancellationTokenSource();
var now = DateTime.Now;
var startDateTime = new DateTime(now.Year, now.Month, now.Day, 16, 49, 00);
// Create a new instance of the Chronograph.TaskScheduler class
// to schedule the execution of the "Boom" method.
var scheduler = new Chronograph.TaskScheduler(
startDateTime, // Specifies the DateTime to start the method
Periodic.Hour, // Specifies how often you want to restart the method, if 'null', the method will run only once on schedule
1, // Specifies the interval to restart the method
true, // If set to 'true', the method will run immediately and then on schedule
boo.Boom, // Specifies the method to run
cts); // Specifies the CancellationTokenSource instance
// Run the scheduler in an individual thread
Task.Run(() => scheduler.JobRunner());
Console.WriteLine("Press Enter to exit...");
Console.ReadLine();
cts.Cancel();
Console.WriteLine("Main thread finished.");
}
public class Boo { // The method to be executed by the scheduler public void Boom() { Console.WriteLine("Boom job ran at " + DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss:fff")); } }
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.