Timer in UiPath

How does one setup a timer (Start time at the beginning and Stop Timer at the end) to help calculate the elapsed time

2 Likes

What have you tried so far?

Hi @kaushiks1,
If you want to find the elapsed time for the whole process, then it’s already calculated and shown in the logs.
Else if you want to find the elapsed time for a specific part of the process,

  • Set a Datetime variable startTime before the specificpart, and assign now
    *Your Process steps goes here
    *After the steps, set another Datetime variable endTime and set now
    *Then find the difference between startTime and end Time.
    Thx.
1 Like

Thank you @shankm … appreciate your suggestion. I will try that.

Although I do find it odd that a Start and Stop Timer is not available within UiPath. (its available within .NET so I assumed it would be available within UiPath too)

Thanks once again.

2 Likes

Well this idea is already in consideration.
Vote for it and hopefully when accepted it will be added to UiPath

Everything you do in .NET can be done in uipath using invoke code activity, just not everything was implemented by uipath as activities…

Glad I found this !! Creating the timer and using Invoke Method to start / stop ended up being easier than I thought. Ended up using this (c# - How do I measure how long a function is running? - Stack Overflow) as the basis for crafting something in my workflow. Works great.

I create a new variable called “TimeHack” and set the Variable Type to System.DateTime.

I Assign that value to “Now”. Then at the end, I compare that time to the “Now” time and get my total duration.

1 Like