I want to send an email at the end of my workflow that tells me how long the process took to complete. I have set a “Start_Time” variable at the start and a “End_Time” variable at the end. both of witch have been set using this code “Start_Time = DateTime.Now.ToString(“hh:mm:ss”)”. Obviously, replacing “Start” with “End” for the “End_Time” variable. To calculate the Time taken ive used this code “(CDate(End_Time) - CDate(Start_Time)).ToString”. This works well. however if the process is started at a time such as 12:58 and ends at 1:03 then i get this result.
Hey @cody.barber
The suggested answer is great!! To add up an alternative procedure you can use System.Diagnostics.Stopwatch so that you can get an accurate elapsed time.
It would be a clean, simple and easy method. Interested give it a look!!
Thank you for the advice. But I don’t want the time of the whole process. I just want the time taken for a certain part of the process. However, ill look into it anyway for future prosses where I might need it. It looks very useful.
Yes… @cody.barber you can calculate the part of the process also.
Whichever activity’s elapsed time you want to calculate can place them in between the two invoke methods.