stopwatch w = new stopwatch(); w.start(); ... w.stop(); console.writeline(w.ellapsedmilliseconds);
我是想在label中顯示程式運行的時間 你以上的代 碼要怎麼使用? w.stop()要放在哪裡去
using System.Diagnostics;Stopwatch w; long sec = 0; w = Stopwatch.StartNew();// put the code you want to calculate the executing time here.sec = w.ElapsedMilliseconds; //Response.Write(sec.ToString());
w.start();
...
w.stop();
console.writeline(w.ellapsedmilliseconds);
你以上的代 碼要怎麼使用?
w.stop()要放在哪裡去
long sec = 0;
w = Stopwatch.StartNew();// put the code you want to calculate the executing time here.sec = w.ElapsedMilliseconds;
//Response.Write(sec.ToString());