Want to have a function called at a random time

Hi all,

Basically I'm wondering what the best approach to programming a solution to call a function after a randomly generated time has been reached. Basically, I have a robot that I have a function written for called "moveRight()"; this function takes a random number in its arguments which makes a DC motor run for a random length of time. I want to have a timer running in the background which will after a random length of time in seconds call this function. This would make the DC motor spin a random amount of time, randomly firing every couple of seconds.

How best would this be done?

Random Seed would be the cheapest option as of now. Look up the example

Thank you! Didn't see this example before, its exactly what I needed :slight_smile: