Anybody got a good algorithm to determine the appropriate time to