DimonSmart.Utils.Progress
1.25409.808
Prefix Reserved
dotnet add package DimonSmart.Utils.Progress --version 1.25409.808
NuGet\Install-Package DimonSmart.Utils.Progress -Version 1.25409.808
<PackageReference Include="DimonSmart.Utils.Progress" Version="1.25409.808" />
<PackageVersion Include="DimonSmart.Utils.Progress" Version="1.25409.808" />
<PackageReference Include="DimonSmart.Utils.Progress" />
paket add DimonSmart.Utils.Progress --version 1.25409.808
#r "nuget: DimonSmart.Utils.Progress, 1.25409.808"
#:package DimonSmart.Utils.Progress@1.25409.808
#addin nuget:?package=DimonSmart.Utils.Progress&version=1.25409.808
#tool nuget:?package=DimonSmart.Utils.Progress&version=1.25409.808
DimonSmart.Progress
Advanced Progress Indicator for .NET Applications
Overview
DimonSmart.Progress is a .NET library providing an advanced progress indicator that helps track, measure, and estimate completion times for long-running operations. Unlike simple progress bars, this indicator can measure individual subtasks and provide accurate time estimates based on actual performance.
Features
- Progress Tracking: Monitor the progress of long-running loops with accurate item counting
- Subtask Measurement: Measure and analyze the time taken by different components of your process
- Estimated Completion Time: Get real-time predictions of when the entire operation will finish
- Performance Analysis: Calculate average times for individual subtasks and iterations
- Sliding Window Analysis: Get more accurate time estimates by using recent iterations (rather than all iterations) for calculations
Installation
dotnet add package DimonSmart.Utils.Progress
Usage
Basic Example
// Initialize with the total number of items to process and optional window size
using var progress = new AdvancedProgressIndicator(totalItems: 1000, windowSize: 10);
// Process items in a loop
for (int i = 0; i < 1000; i++)
{
// Measure a specific subtask
using (progress.BeginSubTask("DataProcessing"))
{
// Perform your operation here
ProcessData(data);
}
// Optionally measure another subtask in the same iteration
using (progress.BeginSubTask("FileSaving"))
{
// Perform another operation
SaveResults(result);
}
// Update the progress counter after completing an iteration
progress.Update();
// Optionally display progress information
Console.WriteLine($"Processed: {i+1}/1000");
if (progress.EstimatedEndTime.HasValue)
Console.WriteLine($"Estimated completion: {progress.EstimatedEndTime.Value}");
Console.WriteLine($"Effective average time per item: {progress.EffectiveAverageItemTime}");
}
Getting Timing Information
You can retrieve timing information for specific subtasks:
TimeSpan dataProcessingTime = progress.GetTaskTime("DataProcessing");
TimeSpan fileSavingTime = progress.GetTaskTime("FileSaving");
Console.WriteLine($"Average data processing time: {dataProcessingTime}");
Console.WriteLine($"Average file saving time: {fileSavingTime}");
API Reference
AdvancedProgressIndicator
The main class providing progress tracking functionality.
Constructor
AdvancedProgressIndicator(int totalItems, int windowSize = 10)
- Initialize with the total number of items to process and optional sliding window size
Properties
ItemsLeft
- Number of items remaining to be processedOverallAverageItemTime
- Average time per iteration based on all processed itemsSlidingAverageItemTime
- Average time per iteration based on the most recent iterations (window size)EffectiveAverageItemTime
- The actual average used for time estimates (uses sliding average if available)EstimatedEndTime
- Projected completion time based on the sliding window average time. Returns null if there's not enough data in the sliding window.
Methods
Update()
- Increment the processed items count and update sliding window time measurementsBeginSubTask(string taskName)
- Start timing a specific subtask (returns IDisposable)GetTaskTime(string taskName)
- Get average execution time for a specific subtask
License
This project is licensed under the 0BSD License - see the LICENSE file for details.
Repository
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
-
net6.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.25409.808 | 172 | 4/9/2025 |
1.25408.1752 | 161 | 4/8/2025 |
1.25408.1541 | 166 | 4/8/2025 |
1.25408.1406 | 164 | 4/8/2025 |