Advertisement
ivan_yosifov

Measure_Time_Limit

Nov 14th, 2013
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.39 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5.     static void Main()
  6.     {
  7.         int sum = 0;
  8.         int startTime = Environment.TickCount;
  9.  
  10.         for (int i = 0; i < 10000000; i++)
  11.         {
  12.             sum++;
  13.         }
  14.  
  15.         int endTime = Environment.TickCount;
  16.         Console.WriteLine("The time elapsed is {0} sec.", (endTime-startTime) / 1000.0);
  17.  
  18.  
  19.         Console.WriteLine();
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement