Is there any simple way to calculate time that is spent in each method that's called from the Update and Draw methods? I want to do this to find bottlenecks in my engine. Is that a good way?
Tell me more
×
Game Development Stack Exchange is a question and answer site for
professional and independent game developers. It's 100% free, no registration required.
|
|
If you want to do it in code as then I suggest you check out System.Diagnostics.Stopwatch class. Its designed for measuring very, very small amounts of time. I personally use the Visual Studio Profiler. One of my favorite features is it will list all the methods along with the % of processing time they occupy. Very useful for finding bottlenecks. |
|||
|
|
|
well Gametime.ElapsedGameTime is how long it takes from frame to frame (however, think its rendering and updating). But, as a comment said, use profiling and good judgement as to whats taking so long. Check any loops because those are generally the reason. Maybe if you could describe any issues you're having, we could help you narrow your search down. |
|||||||
|