fix the benchmark script and add the timing code