object(stdClass)#29 (2) { ["docs"]=> array(0) { } ["count"]=> int(0) } 时间差计算 Stopwatch - 爱码网
YyuTtian

using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;

namespace ConsoleApplication1
{
  class Program
  {
    static void Main(string[] args)
    {
      Stopwatch s = new Stopwatch();
      s.Start();
      for (int i = 0; i < 100000000; i++)
      {
        string ss = i.ToString();
        Console.WriteLine(ss);
      }

      s.Stop();
      Console.WriteLine(s.ElapsedMilliseconds/1000+"秒");
      Console.ReadLine();
    }
  }
}

分类:

技术点:

相关文章: