Chronolap: The Next Generation Stopwatch for .NET Applications
In .NET, the Stopwatch class is one of the most commonly used tools for measuring the duration of operations. However, it has a significant drawback: it does not support lap tracking.
In this article, I will share how I developed an alternative to the classic Stopwatch — a timer class called Chronolap, which supports both synchronous operation and lap tracking with logging capabilities.
🚩 Why Stopwatch Isn’t Enough
Great, clear, and easy to understand. But what if we wanted to measure multiple sections?
The NuGet package I published, “chronolap,” makes this very easy.
First, you need to add it to your project;
dotnet package add chronolapThen, let’s use it in a project as an example;
Actually, the core functionality is this simple. However, usually people want to record these measurements as logs as well. For this, without any extra development, if you inject a Logger object that implements the ILogger interface, the measurements for each lap will be automatically logged.
Get Ertugrul Kara’s stories in your inbox
Join Medium for free to get updates from this writer.
Here is an example of that;
You can use any Logger class you want, whether it’s Console, Serilog, or another — it’s up to your creativity! :)
📚 Conclusion
The Stopwatch class in .NET may be sufficient for basic measurements. However, in real-world scenarios — especially in performance analysis or benchmarking tests — lap tracking can be a lifesaver.
For the code and example project;
👉 GitHub — ertugrulkra/chronolap
If you want, there is also a Python version available. If you have any questions I’m just an email away.
☕ Support the Project
If you like the project, you can support me with a coffee:






