private DispatcherTimer timer = null;
private int x;
private void timerStart () {
timer = new DispatcherTimer(); // если надо, то в скобках указываем приоритет, например DispatcherPriority.Render
timer.Tick += new EventHandler(timerTick);
timer.Interval = new TimeSpan(0, 0, 0, 0, 500);
timer.Start();
}
private void timerTick(object sender, EventArgs e)
{
x++;
}