diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -292,11 +292,8 @@ int main(int argc, char *argv[]) { game->frames = 0; } - /* Sleep for a bit to avoid hogging the CPU. - * This is a fudge - ideally this delay would adapt so that the CPU is not hogged when the GPU is the - * limiting factor, and be zero when the CPU is limiting. I don't know of a sensible way to tell which - * is the case. */ - if ( !gameopts.no_framerate_limit ) usleep(30000); + /* Wait for how long it takes to render the frame at the most recent measurement. */ + if ( !gameopts.no_framerate_limit ) usleep(game->time_to_render/1000); } |