What's the best way to implement a frames per second cap? I'm currently using a system that sleeps a variable amount of time in between frames and updates the variable every second to match the cap. Is this a reasonable way to do things? (I'm also using the actual Sleep() function to do this, and I suspect that may be a bad idea. Is it? and if so, why?)