Median instead of Mean value

In a project of mine, the runtime of some performance tests has huge outliers. As an improvement for robustness, I've added the support for measuring median instead of the mean value.

The patch is a quick hack. I'll welcome any suggestions for improvement.