optimized frame limit sleep

* calculate idealFrameTime only when needed
* only create a new Stopwatch when needed
* disallow wait times > 1 second
Merge pull request #4447 from Mailaender/fps-limit-opt

Optimized frame limit sleep