c#中大致计算算法运行时间

c#中大致计算算法运行时间
using System.Diagnostics;

private Stopwatch stw = new Stopwatch();

stw.reset();
stw.start();

算法....
stw.stop();

String theTime =stw.ElapsedMilliseconds.ToString() + "ms";

你可能感兴趣的:(c#中大致计算算法运行时间)