using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; namespace MutlipleThreads { class NumberPrinter { private int step; public NumberPrinter(int step) { this.step = step; } public void Print(object obj) { Info info = obj as Info; Thread currThread = Thread.CurrentThread; for (int i = info.From; i < info.To; i += step) { Console.WriteLine("{0} is printing {1}", currThread.Name, i); Thread.Sleep(TimeSpan.FromSeconds(info.Pause)); } } } class Info { public int From { get; set; } public int To { get; set; } public int Pause { get; set; } } }