AsyncTimeMeasureOptions Class
Definition
- Namespace
- Cuemon.Diagnostics
- Assemblies
- Cuemon.Diagnostics.dll
Specifies options that is related to TimeMeasure operations. This class cannot be inherited.
public sealed class AsyncTimeMeasureOptions : TimeMeasureOptions, IParameterObject, IAsyncOptions
- Inheritance
-
AsyncTimeMeasureOptions
- Implements
- Inherited Members
Examples
The following example demonstrates how to configure
using System;
using System.Threading;
using Cuemon.Diagnostics;
using Cuemon.Reflection;
namespace MyApp.Examples;
public static class AsyncTimeMeasureOptionsExample
{
public static void Demonstrate()
{
var options = new AsyncTimeMeasureOptions
{
TimeMeasureCompletedThreshold = TimeSpan.FromMilliseconds(100),
CancellationToken = CancellationToken.None,
MethodDescriptor = () => MethodDescriptor.Create(typeof(AsyncTimeMeasureOptionsExample).GetMethod(nameof(Demonstrate))!),
RuntimeParameters = new object[] { "warmup" }
};
Console.WriteLine(options.TimeMeasureCompletedThreshold);
Console.WriteLine(options.CancellationToken.CanBeCanceled);
Console.WriteLine(options.MethodDescriptor().MethodName);
Console.WriteLine(options.RuntimeParameters.Length);
}
}
Constructors
| Name | Description |
|---|---|
| AsyncTimeMeasureOptions() | Initializes a new instance of the TimeMeasureOptions class. |
Properties
| Name | Description |
|---|---|
| CancellationToken | Gets or sets the cancellation token of an asynchronous operations. |