title: System.Threading.Timer maximum dueTime value problem
body: <p><a href="http://msdn.microsoft.com/en-us/library/317hx6fa.aspx" rel="nofollow noreferrer">According to the documentation</a> the maximum dueTime value is 4294967294 milliseconds. But if you set the timer to this value it fires a callback immediately.</p>
  
  <p>Run the below program and click "c" - the callback will fire immediately, click "o", it will fire after 49 days, click "v" it will fire after 1s. Is this a bug or am I doing something wrong?</p>
  
  <pre><code>using System;
  using System.Threading;
  
  namespace Test
  {
      class Program
      {
          private static bool isRunning;
          private static Timer t;
  
          static void Main(string[] args)
          {
              t = new Timer(OnTimerCallback, null, Timeout.Infinite, Timeout.Infinite);
              isRunning = true;
              while (isRunning)
              {
                  var command = Console.ReadKey();
  
                  switch (command.KeyChar)
                  {
                      case 'q':
                          isRunning = false;
                          break;
                      case 'c':
                          t.Change(TimeSpan.FromMilliseconds(4294967294), TimeSpan.FromMilliseconds(-1));
                          break;
                      case 'o':
                          t.Change(TimeSpan.FromMilliseconds(4294000000), TimeSpan.FromMilliseconds(-1));
                          break;
                      case 'v':
                          t.Change(TimeSpan.FromMilliseconds(1000), TimeSpan.FromMilliseconds(-1));
                          break;
                  }
              }
              Environment.Exit(0);
          }
  
          private static void OnTimerCallback(object x)
          {
              Console.WriteLine("Timer callback");
              t.Change(TimeSpan.FromMilliseconds(4294967294), TimeSpan.FromMilliseconds(-1));
          }
      }
  }
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>If you set timer to the max dueTime value in a callback it will not fire immediatelly and will work as expected :)</p>