private void StopStep(ExecutionTimeWatch watch, bool stepStartNotified) { ScenarioExecutionContext.Current.Get <CurrentStepProperty>().RemoveCurrent(this); DisposeComposite(); watch.Stop(); _result.SetExecutionTime(watch.GetTime()); _result.IncludeSubStepDetails(); if (stepStartNotified) { _stepContext.ProgressNotifier.NotifyStepFinished(_result); } }
private async Task TimeMeasuredInvokeAsync() { var watch = ExecutionTimeWatch.StartNew(); try { await _decoratingExecutor.ExecuteStepAsync(this, InvokeStepAsync, _stepDecorators); } finally { _result.SetExecutionTime(watch.GetTime()); } }
private void MeasuredInvoke() { var watch = new Stopwatch(); try { _result.SetExecutionStart(DateTimeOffset.UtcNow); watch.Start(); _action(); } finally { _result.SetExecutionTime(watch.Elapsed); } }
private void MeasuredInvoke(object[] paramValues) { var watch = new Stopwatch(); try { _result.SetExecutionStart(DateTimeOffset.UtcNow); watch.Start(); _action(StepType.Default, _context, paramValues); } finally { _result.SetExecutionTime(watch.Elapsed); } }
private async Task TimeMeasuredInvokeAsync() { var watch = ExecutionTimeWatch.StartNew(); var ctx = AsyncStepSynchronizationContext.InstallNew(); try { try { await _stepInvocation.Invoke(_scenarioContext, PrepareParameters()); } finally { ctx.RestoreOriginal(); await ctx.WaitForTasksAsync(); } } finally { _result.SetExecutionTime(watch.GetTime()); } }