What is the best way of repeatedly executing a method at random time intervals, so for example the code in the method is run at 1s, 3s, 7s, 10s, 11s, 13s, 19s, 22s, etc,. for an infinite amount of time?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I would set a timer and on each time through check against a random number and if that random number hits then call the function:
and in the targetMethod