Class ForcedDelayBlock
Enforces a minimum duration for a block of code execution.
Inherited Members
Namespace: PoeShared.Scaffolding
Assembly: PoeShared.dll
Syntax
public sealed class ForcedDelayBlock : IDisposable, IAsyncDisposable
Constructors
Name | Description |
---|---|
ForcedDelayBlock(double) | Initializes a new instance of the ForcedDelayBlock class. |
ForcedDelayBlock(TimeSpan) |
Properties
Name | Description |
---|---|
Elapsed | Gets the elapsed time since the block started execution. |
MinTime | Gets the minimum execution time for the block. |
Methods
Name | Description |
---|---|
Dispose() | Ensures the block of code takes at least the specified minimum time to execute. If the code finishes earlier, the remaining time is spent sleeping using high-precision synchronous sleep. |
DisposeAsync() | Asynchronously ensures the block of code takes at least the specified minimum time to execute. If the code finishes earlier, the remaining time is spent asynchronously using a high-precision sleep method. |