KhaosKode.Time 1.0.7

Additional Details

This was a bit of an experiment to see how to use nuget. I understand a tiny bit more now than before. Please feel free to look at the KhaosKoder.* series of packages. They replace this package - with absolutely minimal code changes required. I will try to keep the packages stable under those names from here on.

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

Khaos.Time

Internal time abstractions and helpers shared by the Khaos. libraries. Not intended for standalone use.*

Khaos.Time provides deterministic and system-backed clock abstractions (local, UTC, and virtual) that keep the rest of the Khaos ecosystem testable and predictable. Every packable project in this solution ships under the NuGet package ID KhaosCode.Time, and versioning is driven via MinVer + Git tags.

Features

  • ISystemClock interface plus concrete implementations (LocalSystemClock, UtcSystemClock, VirtualSystemClock).
  • Thread-safe virtual clock with manual advancement for deterministic testing.
  • Central SystemClock.Instance for default dependency injection.
  • 100% test coverage (tracked via Coverlet + ReportGenerator) with xUnit tests in tests/Khaos.Time.Tests.

Getting Started

  1. Restore tools and dependencies
     cd scripts
     dotnet tool restore
    
  2. Build the solution
     .\build.ps1
    
  3. Run tests
     .\test.ps1
    
  4. Run tests with coverage (HTML reports land in TestResults/coverage-html)
     .\test-with-coverage.ps1
    

Versioning & Releases

Semantic Versioning 2.0.0 is enforced via MinVer with the tag prefix Khaos.Time/v. All packable projects share the same version per commit. See docs/versioning-guide.md for the complete workflow, including how to:

  • choose MAJOR/MINOR/PATCH bumps,
  • tag a release locally,
  • run the pack pipeline (dotnet pack -c Release).

Packaging

The primary NuGet artifact is produced via:

dotnet pack -c Release

Output lives under src/Khaos.Time/bin/Release (e.g., KhaosCode.Time.<version>.nupkg).

Repository Layout

  • src/Khaos.Time – production library.
  • tests/Khaos.Time.Tests – xUnit test suite with Coverlet instrumentation.
  • scripts/ – PowerShell helpers for build, clean, test, and coverage flows.
  • docs/ – product documentation, including versioning-guide.md.
  • TestResults/ – generated at test time; coverage HTML lives here.

Contributing

This repo is intended for internal Khaos projects. Follow the existing coding style, keep the XML docs up to date, and ensure the scripts succeed locally before raising a PR. For breaking changes, coordinate with downstream Khaos.* maintainers since the clocks are widely shared.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.
  • net8.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.7 92 3/12/2026 1.0.7 is deprecated because it is no longer maintained.