Creating the multiple threads that call same function with different sleep interval
How to create multiple threads that call same function with different sleep interval
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Kirtan PatelRank #292 · 8.6K reputationPosted Aug 18, 2009, 10:40 PM EDT
Here I Have Created Two Thread Each Will Sleep for 100 Mili Seconds and Print the Line :)
dont forget to mark "Do you like answer" if answer helped you . It will Give me Some Credit :)
class Program
{
static void Main(string[] args)
{
Thread t1 = new Thread(MyFunc);
t1.Name = "T1";
t1.Start();
Thread t2 = new Thread(MyFunc);
t2.Name = "T2";
t2.Start();
Console.ReadKey();
}
public static void MyFunc()
{
for (int i = 0; i <= 10; i++)
{
if (Thread.CurrentThread.Name != null)
{
Console.Write("Printed From "+Thread.CurrentThread.Name+"\n");
}
Thread.Sleep(100);
}
}
}
vishvanath shinde2 reputationPosted Aug 29, 2009, 8:58 AM EDT
Just wanted to know the difference between 'Thread thread1 = new Thread(new ThreadStart(ThreadFunction));' and
'Thread thread1 = new Thread(DisplayThread1);'?