title: DispatcherTimer for displaying seconds
body: <p>I am trying to display a simple second counter.  I have a dispatchertimer with a tick interval of 1 second and a textbox which I update in the tick handler with the current amount of seconds.  There is a tiny amount of work in the tick handler, namely a call to 'tostring()' on some ints.</p>
  
  <p>My issue is that the seconds are slower than they should be.  Even if I set the interval to 100 milliseconds and make a check when elapsed, it is still slower than it should be.  (over the course of a minute it is roughly 6 seconds slow).</p>
  
  <p>Can anyone point me in the right direction for displaying a second counter that is accurate?</p>
  
  <p>EDIT:  Some code here (in .xaml.cs). It is taken from an example which works fine.  The difference is that I am setting the Text property of a TextBox, rather than a Value property of another control.</p>
  
  <pre><code>...
          this.timer.Interval = TimeSpan.FromMilliseconds(100);
  ...
  
      private void OnDispatcherTimer_Tick(object sender, EventArgs e) {
          if (this.currentValue &gt; TimeSpan.Zero) {
              this.currentValue = this.currentValue.Value.Subtract(TimeSpan.FromMilliseconds(100));
          } else {
              // stop timer etc
          }
  
          this.seconds.Text = this.currentValue.Value.Seconds.ToString();
      }
  </code></pre>