fork download
  1. using System;
  2. using System.Diagnostics;
  3.  
  4. namespace ConsoleApplication6
  5. {
  6. internal class Program
  7. {
  8. private static void Main()
  9. {
  10. Stopwatch s=new Stopwatch();
  11. int iters = 100;
  12. double a = 0;
  13. s.Start();
  14. for (int q = 0; q < iters; q++)
  15. for (int i = 0; i < 100000; i++)
  16. if (i%2 == 0) a += Math.Sin(i); else a -= Math.Sin(i);
  17. s.Stop();
  18. Console.WriteLine("Result: {0}, time: {1}",a,(double)s.ElapsedMilliseconds/1000);
  19. }
  20. }
  21. }
Success #stdin #stdout 0.54s 33944KB
stdin
Standard input is empty
stdout
Result: -56.4002292586167, time: 0.512