Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Code Execution Time
2 replies. Latest Post by Mike4268 on August 6, 2008.
(0)
Mike4268
Member
24 points
29 Posts
08-06-2008 12:20 PM |
I tried measuring a function using DateTime.Now and TimeSpan.TotalMilliseconds, but that returned either 0 or 15.664, and nothing inbetween.
The full .NET framework has a System.Diagnostics.StopWatch, which I believe is much more precise. Is there anything I can do in silverlight to get more precision?
Mike
robhouwe...
Contributor
3184 points
548 Posts
08-06-2008 2:17 PM |
Can you post your code so we can see if anything is going on with that?
08-06-2008 3:22 PM |
DateTime start, end;
start = DateTime.Now;
end = DateTime.Now;
TimeSpan ts = end - start;
Debug.WriteLine("Time: " + ts.TotalMilliseconds);