This function should be named calculateFPS or something. Other than that, change looks good!