try go testing package. test and benchmark.