Chronolap.OpenTelemetry.Legacy 1.0.0

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

Chronolap.Legacy

Advanced stopwatch library with lap tracking support for .NET developers (Legacy Edition).

Supported Frameworks

Supported .NET Version

Features

  • Lap tracking
  • Measurement time recording
  • Pause / Resume (coming soon)
  • ILogger logging support
  • Synchronous and asynchronous measurement methods

Installation

Install via NuGet:

Install-Package Chronolap.Legacy

Usage

using Chronolap.Legacy;
using System;
using System.Threading;

class Program
{
    static void Main()
    {
        var timer = new ChronolapTimer();

        timer.Start();
        Thread.Sleep(100);
        timer.Lap("First lap");
        Thread.Sleep(200);
        timer.Lap("Second lap");
        timer.Stop();

        foreach (var lap in timer.Laps)
        {
            Console.WriteLine(lap);
        }
    }
}

!Important

Logging Framework is not supported in this version. If you need logging support, please use the Chronolap package instead.

OpenTelemetry Support

Chronolap.Legacy is OpenTelemetry-ready.

You can use Chronolap.OpenTelemetry.Legacy extensions to export lap durations as tags to the current Activity.

Example

using Chronolap.Legacy;
using Chronolap.OpenTelemetry.Legacy;
using System.Diagnostics;

var timer = new ChronolapTimer();
var activitySource = new ActivitySource("MyApp");

using (var activity = activitySource.StartActivity("DoWork"))
{
    timer.Start();
    // ...
    timer.Lap("DB");
    timer.Lap("Calculation");
    timer.Stop();

    activity.ExportAllLaps(timer);
}

Contributing

Contributions are welcome! Please open issues or pull requests.

Support

If you find this project useful, consider supporting me:

Buy Me a Coffee

Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 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 148 7/1/2025