Asp.NET开启一个线程,不停的执行

using System;
using System.Threading;
using System.Threading.Tasks;

class StartNewDemo
{
    static void Main()
    {
        while (true)
        {
            System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ThreadStart(Run));
            thread.Start();
            Thread.Sleep(10000);
        }
    }


    private static void Run()
    {
        Console.WriteLine("aaaa");
        Console.WriteLine();
    }

}

posted @ 2015-07-03 13:26  甜菜波波  阅读(1972)  评论(0编辑  收藏  举报