- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _12foreach循环
- {
- class Program
- {
- static void Main(string[] args)
- {
- //int[] nums = { 1, 2, 3, 4, 5, 6, 76, 7, 8, 23 };
- //for (int i = 0; i < nums.Length; i++)
- //{
- // Console.WriteLine(nums[i]);
- //}
- //Console.WriteLine("=====================================");
- //foreach (var item in nums)
- //{
- // Console.WriteLine(item);
- //}
- //Console.ReadKey();
- //Stopwatch sw = new Stopwatch();
- //int[] nums = new int[1000];
- ////00:00:04.2069219
- ////00:00:00.0000070
- ////00:00:00.0000121
- //sw.Start();
- //foreach (var item in nums)
- //{
- //}
- //for (int i = 0; i < nums.Length; i++)
- //{
- //}
- //sw.Stop();
- //Console.WriteLine(sw.Elapsed);
- //Console.ReadKey();
- }
- }
- }