以下為c#的語法

using System.Diagnostics;


然後再你想要測試的程式中加上
            Stopwatch s = new Stopwatch(); s.Start();
            s.Stop();
            string.Format("Test time: {0}(秒)", s.ElapsedMilliseconds * 1000);


乘以1000是要以秒顯示

arrow
arrow
    全站熱搜

    丫德 發表在 痞客邦 留言(1) 人氣()