# Class DisposableStopwatch OptimaJet.Workflow.Core.Utils.DisposableStopwatch Namespace: [OptimaJet.Workflow.Core.Utils](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Utils/) ```csharp public class DisposableStopwatch : IDisposable ``` ## Type Hierarchy - DisposableStopwatch Current type - Implemented interfaces - [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable) ## Constructors `public DisposableStopwatch(Action action = null)` ### Parameters | Name | Type | Description | | --- | --- | --- | | `action` | `Action` | | ## Methods `public void AddAction(Action action)` Add action which invoke on dispose. Removes others if they were. ### Parameters | Name | Type | Description | | --- | --- | --- | | `action` | `Action` | | `public void SetAction(Action action)` Set action which invoke on dispose. Removes others if they were. ### Parameters | Name | Type | Description | | --- | --- | --- | | `action` | `Action` | | `public void Dispose()` [Previous Deactivated](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Utils/Deactivated-T/) [Next DisposableStopwatchArgs](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Utils/DisposableStopwatchArgs/)