How to get totalExecutionTime?

I would like to realize popup which shows processing time at last step.
I know log includes totalExecutionTime, so I wonder if there are some way to get this time.
I’ve already implemented two activities to get time using CurrentDate activity, at first and last step, then calculate time difference, but it does not look smart…

Hi,
Stopwatch is designed for this purpose and is one of the best way to measure time execution in .NET.
var watch = System.Diagnostics.Stopwatch.StartNew();
// the code that you want to measure comes here
watch.Stop();
var elapsedMs = watch.ElapsedMilliseconds;

for xaml.

1 Like

Hi, thank you for sharing.
I think both Stopwatch and two CurrentDate do not use totalExecutionTime.
Both way can manually get almost processing time, so these are similar.
I would like to know whether I can get totalExecutionTime, because it seems standard variable.

You can try the below stopwatch activities