how to calculate maximum time frame