What is the purpose of calculateFramerate?