Sign in to follow this  
donjonson

I noticed something strange when timing different portions of my code

Recommended Posts

donjonson    271
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
JohnBolton    1372
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this