Clean up the timing code in merge so that we measure only what is significant.
Add option to specify the sampling size.