fork download
  1. using System;
  2. using System.Threading;
  3.  
  4. public class Test
  5. {
  6. private static long gcd (long a, long b) {
  7. while (b != 0) {
  8. long tmp = a % b;
  9. a = b; b = tmp;
  10. }
  11. return a;
  12. }
  13.  
  14. public static void Main()
  15. {
  16. long t0 = DateTime.Now.Ticks;
  17.  
  18. Thread.Sleep(1);
  19.  
  20. long step = DateTime.Now.Ticks - t0;
  21.  
  22. for (int i = 0; i < 1000; i++) {
  23. long dt = DateTime.Now.Ticks - t0;
  24. step = gcd(step, dt);
  25. }
  26.  
  27. Console.WriteLine( step );
  28. }
  29. }
Success #stdin #stdout 0.03s 37048KB
stdin
Standard input is empty
stdout
10