From 41e0835d1792f362e6c1e1289df000a1a9475092 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sun, 11 Nov 2007 00:36:19 +0100 Subject: [PATCH] Add a step function to the profiler to easily switch to another event of the same category. Before: After: PlProfiler::start("Machin", "truc"); PlProfiler::start("Machin", "truc"); do_truc(); do_truc(); PlProfiler::stop("Machin"); PlProfiler::start("Machin", "bidule"); PlProfiler::step("Machin", "bidule"); do_bidule(); do_bidule(); PlProfiler::stop("Machin"); PlProfiler::stop("Machin); Signed-off-by: Florent Bruneau --- classes/plprofiler.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/classes/plprofiler.php b/classes/plprofiler.php index 3b66426..7b6106b 100644 --- a/classes/plprofiler.php +++ b/classes/plprofiler.php @@ -34,6 +34,12 @@ class PlProfiler return true; } + static public function step($name, $info = "action") + { + PlProfiler::stop($name); + PlProfiler::start($name, $info); + } + static public function stop($name) { global $globals; -- 2.1.4