upstream and downstream time formula