Search Results for

    Show / Hide Table of Contents
    View Source

    Class TimedScope

    Makes a code block timed (take at least a certain amount of time). This class cannot be inherited.

    Inheritance
    System.Object
    Namespace: Umbraco.Cms.Core
    Assembly: Umbraco.Core.dll
    Syntax
    public sealed class TimedScope : IDisposable

    Constructors

    View Source

    TimedScope(Int64)

    Initializes a new instance of the TimedScope class.

    Declaration
    public TimedScope(long millisecondsDuration)
    Parameters
    Type Name Description
    System.Int64 millisecondsDuration

    The number of milliseconds the scope should at least take.

    View Source

    TimedScope(Int64, CancellationToken)

    Initializes a new instance of the TimedScope class.

    Declaration
    public TimedScope(long millisecondsDuration, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    System.Int64 millisecondsDuration

    The number of milliseconds the scope should at least take.

    CancellationToken cancellationToken

    The cancellation token.

    View Source

    TimedScope(Int64, TimeProvider)

    Initializes a new instance of the TimedScope class.

    Declaration
    public TimedScope(long millisecondsDuration, TimeProvider timeProvider)
    Parameters
    Type Name Description
    System.Int64 millisecondsDuration

    The number of milliseconds the scope should at least take.

    TimeProvider timeProvider

    The time provider.

    View Source

    TimedScope(Int64, TimeProvider, CancellationToken)

    Initializes a new instance of the TimedScope class.

    Declaration
    public TimedScope(long millisecondsDuration, TimeProvider timeProvider, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    System.Int64 millisecondsDuration

    The number of milliseconds the scope should at least take.

    TimeProvider timeProvider

    The time provider.

    CancellationToken cancellationToken

    The cancellation token.

    View Source

    TimedScope(TimeSpan)

    Initializes a new instance of the TimedScope class.

    Declaration
    public TimedScope(TimeSpan duration)
    Parameters
    Type Name Description
    TimeSpan duration

    The duration the scope should at least take.

    View Source

    TimedScope(TimeSpan, CancellationToken)

    Initializes a new instance of the TimedScope class.

    Declaration
    public TimedScope(TimeSpan duration, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    TimeSpan duration

    The duration the scope should at least take.

    CancellationToken cancellationToken

    The cancellation token.

    View Source

    TimedScope(TimeSpan, TimeProvider)

    Initializes a new instance of the TimedScope class.

    Declaration
    public TimedScope(TimeSpan duration, TimeProvider timeProvider)
    Parameters
    Type Name Description
    TimeSpan duration

    The duration the scope should at least take.

    TimeProvider timeProvider

    The time provider.

    View Source

    TimedScope(TimeSpan, TimeProvider, CancellationToken)

    Initializes a new instance of the TimedScope class.

    Declaration
    public TimedScope(TimeSpan duration, TimeProvider timeProvider, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    TimeSpan duration

    The duration the scope should at least take.

    TimeProvider timeProvider

    The time provider.

    CancellationToken cancellationToken

    The cancellation token.

    Properties

    View Source

    Elapsed

    Gets the elapsed time.

    Declaration
    public TimeSpan Elapsed { get; }
    Property Value
    Type Description
    TimeSpan

    The elapsed time.

    View Source

    Remaining

    Gets the remaining time.

    Declaration
    public TimeSpan Remaining { get; }
    Property Value
    Type Description
    TimeSpan

    The remaining time.

    Methods

    View Source

    Cancel()

    Cancels the timed scope.

    Declaration
    public void Cancel()
    View Source

    CancelAsync()

    Cancels the timed scope asynchronously.

    Declaration
    public async Task CancelAsync()
    Returns
    Type Description
    Task
    View Source

    Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

    Declaration
    public void Dispose()
    Remarks

    This will block using until the remaining time has elapsed, if not cancelled.

    View Source

    DisposeAsync()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

    Declaration
    public async ValueTask DisposeAsync()
    Returns
    Type Description
    ValueTask

    A task that represents the asynchronous dispose operation.

    Remarks

    This will delay using until the remaining time has elapsed, if not cancelled.

    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • TimedScope(Int64)
      • TimedScope(Int64, CancellationToken)
      • TimedScope(Int64, TimeProvider)
      • TimedScope(Int64, TimeProvider, CancellationToken)
      • TimedScope(TimeSpan)
      • TimedScope(TimeSpan, CancellationToken)
      • TimedScope(TimeSpan, TimeProvider)
      • TimedScope(TimeSpan, TimeProvider, CancellationToken)
    • Properties
      • Elapsed
      • Remaining
    • Methods
      • Cancel()
      • CancelAsync()
      • Dispose()
      • DisposeAsync()
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX