Create Random Timer Delay

I’m trying to create a random timer between 1 to 60 seconds using new Random().Next(1,60) which works great, but in order to use this in a Delay function it needs to be formatted correctly and struggling to convert the random integer to the required date format.

1 Like

It should work with this syntax for the delay activity:
Timespan.FromMilliseconds(yourVariable)

2 Likes

It should be TimeSpan.FromSeconds(yourvariable) as @ocnuybear is trying to get delay in seconds!
here is an example:
Dynamic Delay.xaml (5.5 KB)

7 Likes

Thank you guys:grinning:

1 Like