Class DisposableTimer
Starts the timer and invokes a callback upon disposal. Provides a simple way of timing an operation by wrapping it in a
using (C#) statement.
Namespace: Umbraco.Cms.Core.Logging
Assembly: Umbraco.Core.dll
Syntax
public class DisposableTimer : DisposableObjectSlim
Properties
View SourceStopwatch
Declaration
public Stopwatch Stopwatch { get; }
Property Value
| Type | Description |
|---|---|
| System.Diagnostics.Stopwatch |
Methods
View SourceDisposeResources()
Disposes resources.
Declaration
protected override void DisposeResources()
Remarks
Overrides abstract class DisposableObjectSlim which handles required locking.
Fail(String, Nullable<Exception>)
Reports a failure.
Declaration
public void Fail(string failMessage = null, Exception? exception = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | failMessage | The fail message. |
| System.Nullable<Exception> | exception | The exception. |
Remarks
Completion of the timer will be reported as an error, with the specified message and exception.