感覺用c#進行開發就是快
using system;
using system.threading;
namespace consoleapplication1
{
/// <summary>
/// class1 的摘要說明。
/// </summary>
class class1
{
/// <summary>
/// 應用程序的主入口點。
/// </summary>
[stathread]
static void main(string[] args)
{
//
// todo: 在此處添加代碼以啟動應用程序
//
thread thread1 = new thread(new threadstart(method1));
thread thread2 = new thread(new threadstart(method2));
thread1.start();
thread2.start();
}
public static void method1()
{
while(true)
{
console.writeline("this is thread : 1");
thread.sleep(1000);
}
}
public static void method2()
{
while (true)
{
console.writeline("this is thread : 2");
thread.sleep(1520);
}
}
}
}
新聞熱點
疑難解答