Add a new PlProfiler tool based on PlBacktrace.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 10 Nov 2007 22:36:50 +0000 (23:36 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 10 Nov 2007 22:36:50 +0000 (23:36 +0100)
commit58f9dc78229079745f20c50c13db39898deef96d
tree993a73d89d9fc32689849a243734298671f93bb0
parentc321aa99efb2ced7b3785a1e9b50d3fb19edd4a9
Add a new PlProfiler tool based on PlBacktrace.

To use:
Just add
PlProfiler::start("category", "event");
PlProfiler::stop("category");

so, if you want both to profile a loop and each step of the loop:
PlProfiler::start("my loop");
for ($i = 0 ; $i < 2000 ; ++$i) {
  PlProfiler::start("my step", $i);
  do_sth();
  PlProfiler::stop("my step");
}
PlProfiler::stop("my loop");

The result will be displayed as a backtrace by category.

Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
ChangeLog
classes/plprofiler.php [new file with mode: 0644]