I'm trying to measure the elapsed time in milliseconds between keypress events using a send timer, but when declaring a send timer with an interval of 1 millisecond and then setting a tick event does not work every 1 millisecond, but somewhere like 10-100 milliseconds (guess). How can I accurately measure time in milliseconds if this event does not fire on time? I am doing this in silverlight, which does not seem to have access to System.Timers. The same thing happens with System.Threading.Timer.
Here's the basics of the code:
public void StartTimer(object o, RoutedEventArgs sender) { System.Windows.Threading.DispatcherTimer myDispatcherTimer = new System.Windows.Threading.DispatcherTimer(); myDispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 1);
Any ideas?
source share