I've read over and over again, its the best way to optimize your queries. Test them and see which performs better. So how do you set up a benchmark test?

From what I read, it seems like there is a way to execute a query, hundreds, even thousands of times and compile the mean data. Is this how benchmarking works, and ....how do you do it!?