Move timing code outside of benchmark