Q:

Call method after random interval of time

I have 5 methods and I need them to be called after random interval(1 to 3 sec) of time. Say first method is called after 1 sec, then second method is called after 2.3 sec, next method after 1.5 etc. I did following using timer
    Random rand = new Random();
    fortimerinterval1 = rand.Next(1000, 3000);
    mytimer1.Interval = fortimerinterval1; 
    mytimer1.Enabled = true;
    mytimer1.Start();

But the problem is, timer interval do not change everytime. Timer interval remain constant after first time. How to make it random so that each time timer interval change. 

A:

Do something like this
Random rand = new Random();
Timer mytimer = new Timer();

private void button1_Click(object sender, EventArgs e)
{
    mytimer.Tick += new EventHandler(TimerEventProcessor);
    int fortimerinterval = rand.Next(1000, 3000);
    mytimer.Interval = fortimerinterval;
    mytimer.Enabled = true;
    mytimer.Start();
}

public void TimerEventProcessor(Object myObject, EventArgs myEventArgs)
{
    int fortimerinterval = rand.Next(1000, 3000);
    mytimer.Interval = fortimerinterval;

    System.Diagnostics.Debug.WriteLine(DateTime.Now);
}

A:

Set the interval in your timer elapsed method.
    Random rand = new Random();

    private void OnTick(object sender, EventArgs eventArgs)
    {

        _timer.Interval = rand.Next(1000, 3000);
    }

