Benchmarking script in CakePHP
This is a small CakePHP plugin I wrote to quickly track how long my code was taking to run.
- Copy the contents into your
app/Plugin/directory - Load the plugin in your
bootstrap.phpfile
- Include
App::uses('Benchmark', 'Benchmark.Vendor');wherever you want to use the function. For app-wide use, include it in yourbootstrap.phpfile - Include
Benchmark::set('[BENCHMARK LABEL]');wherever you'd like to track your progress - Output your progress by including the PHP code
echo $this->element('Benchmark.table'); - Optionally you can use the component
CallbackBenchmarkComponent.phpfor some automatically generated benchmarks based on callbacks