[.net] C# MDX Timing

Started by
6 comments, last by remigius 17 years, 6 months ago
Where should I begin to look to find out about timing in C# + MDX both for logic, and < CPU usage? When looking through code, I noticed someone had used Threads.
Advertisement
I'm not 100% sure what your looking for. But if your looking for general ways to time things in MDX, check out: Timing and Frames Per Second
That's basically what I'm looking for, only I guess I'd rather not deal with using unmanaged code. I was assuming that there was some sort of support for that within Manged DirectX, or in a managed System assembly. Anything like that?
QueryPerformanceCounter has the highest resolution amoung timers, but that doesn't mean you have to use it to measure something simple like FPS. There's also the WinForms Timer, System.Timers and Environment.TickCount. Those are the only ones I know of, there might be more.
That should be good, I'll take a look and probably ask more questions once I can't figure out how to implement them ;-)
Perfecto. Thanks!
There was a great discussion about this in the Timing Is Everything thread. Eventually, nagromo came up with a solution that used QueryPerformanceCounter, followed by Environment.TickCount if that's not available.
Rob Loach [Website] [Projects] [Contact]
If you're using .NET 2.0, another option is the System.Diagnostics.Stopwatch class, which is similar to the timer used in the SDK Framework and Nagromo's solution.
Rim van Wersch [ MDXInfo ] [ XNAInfo ] [ YouTube ] - Do yourself a favor and bookmark this excellent free online D3D/shader book!

This topic is closed to new replies.

Advertisement