Chneau.TimeTable 1.0.0

dotnet add package Chneau.TimeTable --version 1.0.0
                    
NuGet\Install-Package Chneau.TimeTable -Version 1.0.0
                    
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="Chneau.TimeTable" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Chneau.TimeTable" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Chneau.TimeTable" />
                    
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 Chneau.TimeTable --version 1.0.0
                    
#r "nuget: Chneau.TimeTable, 1.0.0"
                    
#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 Chneau.TimeTable@1.0.0
                    
#: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=Chneau.TimeTable&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Chneau.TimeTable&version=1.0.0
                    
Install as a Cake Tool

timetable-cs

NuGet License: MIT

A modern, high-performance capacity and schedule constraint evaluation engine in C# (.NET 10).

Ported from chneau/timetable (Go) and chneau/timetable-java (Java 26), with full generic math (INumber<T>) support and seamless integration with Chneau.OpenHours.

Features

  • Generic Capacity Math: Works with any numeric type (int, long, double, float, decimal) via .NET INumber<T>.
  • Immutable Timeline Design: Safe concurrency with structural sharing and state updates.
  • Schedule Constraint Integration: Pluggable IWhenable interface directly compatible with OpenHours expressions.
  • Zero-Allocation Queries: Fast capacity evaluations and constraint searches.
  • High-Performance JSON Serialization: Custom System.Text.Json converter.

Installation

dotnet add package Chneau.TimeTable

Quick Start

using Chneau.OpenHours;
using Chneau.TimeTable;

// 1. Create a timetable with an OpenHours schedule constraint
var oh = OpenHours.Parse("Mo-Fr 09:00-17:00");
var tt = new TimeTable<int>(max: 5, openHours: oh);

var mondayMorning = new DateTime(2026, 8, 24, 10, 0, 0, DateTimeKind.Utc);
var oneHour = TimeSpan.FromHours(1);

// 2. Reserve capacity
var updated = tt.Add(mondayMorning, oneHour, cap: 2);
if (updated != null)
{
    Console.WriteLine($"Reserved successfully! Current points: {updated.Count}");
}

// 3. Find the soonest available slot for a 2-hour task requiring 4 slots of capacity
DateTime? nextAvailable = tt.When(mondayMorning, TimeSpan.FromHours(2), cap: 4);
Console.WriteLine($"Next slot: {nextAvailable}");

Benchmarks

Run benchmarks locally:

dotnet test -c Release --filter TestRunBenchmarkSuite --logger "console;verbosity=detailed"

Sample results (.NET 10 on AMD Ryzen 9):

Benchmark Calls Total Time Per Operation Allocations
Sequential Add 50,000 155 ms 3.1 μs/op 920 B/op
Capacity Search (When) 20,000 7.8 ms 0.39 μs/op 105 B/op
JSON Deserialization 10,000 36.5 ms 3.6 μs/op 664 B/op

License

MIT © chneau

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.

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.0 91 9/5/2026