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
<PackageReference Include="Chronolap.OpenTelemetry.Legacy" Version="1.0.0" />
<PackageVersion Include="Chronolap.OpenTelemetry.Legacy" Version="1.0.0" />
<PackageReference Include="Chronolap.OpenTelemetry.Legacy" />
paket add Chronolap.OpenTelemetry.Legacy --version 1.0.0
#r "nuget: Chronolap.OpenTelemetry.Legacy, 1.0.0"
#:package Chronolap.OpenTelemetry.Legacy@1.0.0
#addin nuget:?package=Chronolap.OpenTelemetry.Legacy&version=1.0.0
#tool nuget:?package=Chronolap.OpenTelemetry.Legacy&version=1.0.0
Chronolap.Legacy
Advanced stopwatch library with lap tracking support for .NET developers (Legacy Edition).
Supported Frameworks
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:
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
-
.NETFramework 4.7.2
- Chronolap.Legacy (>= 1.0.0)
- System.Diagnostics.DiagnosticSource (>= 4.5.1)
- System.Diagnostics.Tracing (>= 4.5.1)
- System.Runtime.CompilerServices.Unsafe (>= 4.5.3)
- System.Threading.Tasks.Extensions (>= 4.5.4)
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 |