Fork me on GitHub

C#计时器 Stopwatch 使用demo

 Stopwatch st = new Stopwatch();
        st.Start();
        for(int i =0; i<100000; i++)
        {
             console.writeLine('输出');
        }
        st.Stop();
        TimeSpan ts = st.Elapsed;
        BaseHelper.WriteLogs("经办流程列表", String.Format("共计{0}人,耗时{1}ms,{2}分钟:", allUser.Count() + "", ts.TotalMilliseconds + "", ts.TotalMinutes + ""));

  

posted @ 2022-10-13 11:24  WantRemake  阅读(55)  评论(0编辑  收藏  举报