How to benchmark in a program