Quantcast
Viewing latest article 4
Browse Latest Browse All 12

Using timers and DateTime.Now

...for Windows Phone 7, I was reading about dispatch timers or something)...

Hi, I don't develop on the phone so this might be useless advise however on the Xbox most people suggest using a Stopwatch not a dispatch timer.

http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx


using System.Diagnostics;  
 
    public class Something  
    {  
        private Stopwatch timer;  
 
        public Something()  
        {  
            timer = Stopwatch.StartNew();  
        }  
 
        public TimeSpan CurrentTime()  
        {  
            return timer.Elapsed;  
        }  
    }  
     

Regards

Viewing latest article 4
Browse Latest Browse All 12

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>