Add generic benchmarking code.