PerformanceBenchmark 1.0.5
dotnet add package PerformanceBenchmark --version 1.0.5
NuGet\Install-Package PerformanceBenchmark -Version 1.0.5
<PackageReference Include="PerformanceBenchmark" Version="1.0.5" />
<PackageVersion Include="PerformanceBenchmark" Version="1.0.5" />
<PackageReference Include="PerformanceBenchmark" />
paket add PerformanceBenchmark --version 1.0.5
#r "nuget: PerformanceBenchmark, 1.0.5"
#:package PerformanceBenchmark@1.0.5
#addin nuget:?package=PerformanceBenchmark&version=1.0.5
#tool nuget:?package=PerformanceBenchmark&version=1.0.5
Class and Method Profiler
The Class and Method Profiler is a utility class that allows you to profile the performance of a specific method in your C# application. It measures the execution time of the method and logs the results for analysis. This can be helpful in identifying performance bottlenecks and optimizing your code.
Installation
Install it as Nuget package
Usage
To use the Profile method, follow these steps:
- Include the
PerformanceBenchmarknamespaces in your code file:
using PerformanceBenchmark;
Example:
public static void Main(string[] args)
{
var q = new Queue<int>();
int iterations = Int32.MaxValue / 2;
int i = int.MinValue;
i = int.MinValue;
Profile("original queue push", iterations, () =>
{
q.Enqueue(i);
q.Dequeue();
});
}
2. Call the `Profile` method, providing the necessary parameters:
Profile("Description of the method being profiled", numberOfIterations, MethodToProfile);
Description: A string that describes the purpose or nature of the method being profiled.numberOfIterations: An integer specifying the number of times the method should be executed for profiling.MethodToProfile: A delegate representing the method to be profiled. It should have a compatible signature with theActiondelegate.
- Review the logged results:
The Profile method logs the execution time for each iteration of the method being profiled. The logged information is stored in a file named "log.txt".
To view the profiling results, open the "log.txt" file using a text editor or any associated application capable of displaying text files.
Contributing
Contributions to the Class and Method Profiler are welcome! If you encounter any issues, have suggestions for improvements, or want to contribute new features, please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature. - Make your changes and commit them:
git commit -m 'Add some feature'. - Push to the original branch:
git push origin feature/your-feature. - Create a pull request.
Please ensure that your contributions align with the project's coding style and conventions.
License
Feel free to modify and adapt the Class and Method Profiler to suit your needs.
| 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.