Я создал класс потоков и начал эту тему.как начать поток за период времени
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace Thread_class
{
class Program
{
class SubThread
{
public void PrintValue()
{
for (int i = 0; i < 10; i++)
{
Console.WriteLine("Inside PrintValue() of SubThread Class " + i);
Thread.Sleep(5);
}
}
}
static void Main(string[] args)
{
SubThread subthread=new SubThread();
Thread thread = new Thread(new ThreadStart(subthread.PrintValue));
thread.Start();
for (int i = 0; i < 10; i++)
{
Console.WriteLine("Inside Main Class " + i);
Thread.Sleep(1);
}
thread.Join();
}
}
}
Как я могу выполнить вышеуказанный метод за каждый определенный период времени? Возможно ли использование резьбы. Метод таймера для установки периода времени для запуска потока?