TimeQuality.Core 1.0.0

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

TimeQuality.Core

A lightweight, dependency-free .NET library for evaluating time synchronization quality.

Overview

TimeQuality.Core answers one specific question: "Given a stream of time offset measurements, is my time synchronization stable and good enough — right now?"

The library ingests timestamped offset samples, computes drift, jitter, and key statistics, then emits a deterministic health snapshot suitable for monitoring, testing, and analysis.

Design Principles

  • Small surface area, high impact
  • Pure math only (no IO, no charts, no exporters)
  • Deterministic outputs for the same inputs
  • Test-first friendly
  • Zero external dependencies

Installation

dotnet add package TimeQuality.Core

Quick Start

using TimeQuality.Core;

// Configure policy and windowing
var policy = TimeQualityPolicy.Default();
var window = WindowConfig.CountBased(300);
var analyzer = new TimeQualityAnalyzer(policy, window);

// Add samples as they arrive
analyzer.AddSample(new TimeSample(
    Timestamp: DateTimeOffset.UtcNow,
    OffsetNs: 1500,
    DelayNs: 250
));

// Get current health snapshot
var snapshot = analyzer.GetSnapshot();
Console.WriteLine($"State: {snapshot.State}");
Console.WriteLine($"Mean Offset: {snapshot.MeanOffsetNs} ns");
Console.WriteLine($"Drift: {snapshot.DriftNsPerSec} ns/s");

Core Concepts

TimeSample: A single time offset measurement with timestamp, offset (ns), and optional delay (ns).

Windowing: Supports count-based (keep last N samples) or time-based (keep samples within duration) windows.

Metrics: Computes mean offset, p95/p99 percentiles, max offset, jitter (successive differences), and drift (linear regression slope).

Health Policy: Evaluates metrics against thresholds to classify synchronization as Good, Warning, or Bad.

Units

All time values use nanoseconds (ns) for offsets and delays. Drift is expressed in ns/s (nanoseconds per second).

Documentation

See DEEPDIVE.md for detailed documentation on metrics, windowing behavior, and health evaluation.

License

MIT License - see LICENSE for details.

Tags

timing ptp white-rabbit ntp synchronization metrics drift jitter

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.
  • net10.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.0 108 1/9/2026