How to use Timer activities in UiPath

Sometimes we need to know the execution time, it is taking for a particular activity or a series of activities in process automation.

That’s when these timer activities come into the picture, which helps us to find the execution time.

What are the different activities that are in the timer activities are shown below:

timer activities

Let’s talk about this by looking at the below example:

timer activities

Start Timer:

This activity will start the timer.

Properties:

It has only output property.

Timer: Create a variable of type Timer.

Reset Timer:

This activity will reset the time it is saved till that activity.

Let’s say we have two sets of sequences where you need to calculate the execution time then we can need to reset the timer before starting the second sequence.

This is when the reset timer is useful.

By using this activity it will reset the timer to zero but it doesn’t start the timer again. So, it will be zero for the rest of the sequence of activities.

In order to start the timer again, we need to use Resume Timer Activity.

Properties:

It has only input property.

Timer: Takes timer object as input.

Resume Timer:

This activity will resume the timer when it is reset using Reset Timer Activity.

Properties:

It has only input property.

Timer: Takes timer object as input.

Stop Timer:

This activity will stop the timer.

Finally, we need to stop the timer to get the time it took to execute the set of activities.

Properties:

It has only output property.

Timer: Takes timer object as input.

Output:

The output for the example we are working on is as shown below:

timer activities

It also helps a great deal when we are documenting the automation process and want to know the execution time of each sequence or combination of sequences.

In order to get the time in Milliseconds use the below code:

timedata.ElapsedMilliseconds.ToString

In order to get the time in timespan use the below code:

timedata.Elapsed.ToString

Want to learn more interesting topics? Check out our YouTube Channel

Happy Learning!

Like this post then let your friends know about this-:

1 thought on “How to use Timer activities in UiPath

Leave a Reply

Your email address will not be published. Required fields are marked *