Refactor computation of mean time
Compute median time instead of mean