Average time as slider value?

Thanks but I think I solved it, the calculation was right but it needed to be inverted using 1-x.