Calculate fps correctly