Chronograph 1.0.4

dotnet add package Chronograph --version 1.0.4
                    
NuGet\Install-Package Chronograph -Version 1.0.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Chronograph" Version="1.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Chronograph" Version="1.0.4" />
                    
Directory.Packages.props
<PackageReference Include="Chronograph" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Chronograph --version 1.0.4
                    
#r "nuget: Chronograph, 1.0.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Chronograph@1.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Chronograph&version=1.0.4
                    
Install as a Cake Addin
#tool nuget:?package=Chronograph&version=1.0.4
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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.

Version Downloads Last Updated
1.0.4 294 6/19/2023
1.0.3 250 6/19/2023
1.0.2 243 6/19/2023
1.0.1 264 6/16/2023
1.0.0 253 6/16/2023