Nessuna descrizione
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Test.cs 633B

123456789101112131415161718192021222324252627
  1. using System;
  2. using System.Diagnostics;
  3. namespace TestConsoleApp
  4. {
  5. class Test
  6. {
  7. public static void Execute()
  8. {
  9. var stopWatch = Stopwatch.StartNew();
  10. for (int i = 0; i < 99999; i++)
  11. {
  12. var a = 0;a += i;a++;
  13. }
  14. Console.WriteLine("{0}", stopWatch.Elapsed.TotalMilliseconds);
  15. var stopWatch2 = Stopwatch.StartNew();
  16. for (int i = 0; i < 99999; i++)
  17. {
  18. var a = 0; a += i; a++;
  19. }
  20. Console.WriteLine("{0}", stopWatch2.Elapsed.TotalMilliseconds);
  21. }
  22. }
  23. }