How to get totalExecutionTime?


#1

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…


#2

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.


#3

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.


#4

You can try the below stopwatch activities