• Advertisement
Sign in to follow this  

I noticed something strange when timing different portions of my code

This topic is 4583 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I timed how long it takes to draw the screen with the querry performance counter and my results were odd. Every other cycle it took about .012 seconds to run the rendering and blitting commands. the other times were e^-6. That is a huge difference. Here is what I think is happening and perhaps someone can refute or confirm my hypothosis. I beleive that dx is trying to keep the screen at 60 Hz and there for if i call the rendering command before the timer runs out it will just skip through the procedure and that is why it only takes microseconds instead of 12 miliseconds. is that right? What i have done since then is use my own timer to lock the screen at 60Hz and it actually runs alot smoother.

Share this post


Link to post
Share on other sites
Advertisement
I don't think your hypothesis is correct but I think you are on the right track. What exactly are you timing? Make sure you are using D3DPRESENT_INTERVAL_IMMEDIATE so that your timing doesn't include waiting for sync.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement