title: Environment.TickCount is not enough
body: <p>I want to know on when was the last time the system was started.</p>
  
  <p>Environment.TickCount will work but it is breaking after 48-49 days because of the limitation of int.</p>
  
  <p>This is the code I've been using:</p>
  
  <pre><code>Environment.TickCount &amp; Int32.MaxValue
  </code></pre>
  
  <p>Does anyone knows about long type return somehow?</p>
  
  <p>I am using this to know the idle time of the system:</p>
  
  <pre><code>public static int GetIdleTime()
  {
      return (Environment.TickCount &amp; Int32.MaxValue)- (int)GetLastInputTime();
  }
  
  /// &lt;summary&gt;
  /// Get the last input time from the input devices.
  /// Exception: 
  /// If it cannot get the last input information then it throws an exception with 
  /// the appropriate message.
  /// &lt;/summary&gt;
  /// &lt;returns&gt;Last input time in milliseconds.&lt;/returns&gt;
  public static uint GetLastInputTime()
  {
      LastInputInfo lastInPut = new LastInputInfo();
      lastInPut.BlockSize = (uint)System.Runtime.InteropServices.Marshal.SizeOf(lastInPut);
      if (!GetLastInputInfo(ref lastInPut))
      {
          throw new Exception(GetLastError().ToString());
      }
  
      return lastInPut.Time;
  }
  </code></pre>