From 08f6020b0085842d4ae81949a0f4886c94158a55 Mon Sep 17 00:00:00 2001
From: admin
Here's an example using real code:
-$this->benchmark->mark('start');
+$this->benchmark->mark('code_start');
// Some code happens here
-$this->benchmark->mark('end');
+$this->benchmark->mark('code_end');
-echo $this->benchmark->elapsed_time('start', 'end');
+echo $this->benchmark->elapsed_time('code_start', 'code_end');
-Note: The words "start" and "end" are arbitrary. They are simply words used to set two markers. You can +
Note: The words "code_start" and "code_end" are arbitrary. They are simply words used to set two markers. You can use any words you want, and you can set multiple sets of markers. Consider this example:
$this->benchmark->mark('dog');
@@ -124,6 +124,32 @@ echo $this->benchmark->elapsed_time('cat', 'bird');
echo $this->benchmark->elapsed_time('dog', 'bird');
+
+If you want your benchmark data to be available to the +Profiler all of your marked points must be set up in pairs, and +each mark point name must end with _start and _end. +Each pair of points must otherwise be named identically. Example:
+ +
+$this->benchmark->mark('my_mark_start');
+
+// Some code happens here...
+
+$this->benchmark->mark('my_mark_end');
+
+
+$this->benchmark->mark('another_mark_start');
+
+// Some more code happens here...
+
+$this->benchmark->mark('another_mark_end');
+
+Please read the Profiler page for more information.
+
+
+
Displaying Total Execution Time
@@ -155,42 +181,6 @@ system using the following code in one of your view file:
{memory_usage}
-
-Auto Profiler
-
-When the "auto profiler" is enabled, you'll see a report printed at the bottom of your pages containing a list of
-execution times for all benchmarks you have set throughout your application. This information can help you optimize your program.
-
-Note: Even though this is a feature of the Benchmark class you will enable it from the Output class as indicated below.
-
-To enable the profiler place the the following function anywhere within your Controllers:
-$this->output->enable_profiler(TRUE);
-
-When enabled you'll see a table of execution times at the bottom of your pages.
-
-To disable the profiler you will use:
-$this->output->enable_profiler(FALSE);
-
-Important: In order to use this feature all of your marked points must end with _start and _end, and
-each pair of points must otherwise be named identically. Example:
-
-
-$this->benchmark->mark('my_mark_start');
-
-// Some code happens here...
-
-$this->benchmark->mark('my_mark_end');
-
-
-$this->benchmark->mark('another_mark_start');
-
-// Some more code happens here...
-
-$this->benchmark->mark('another_mark_end');
-
-
-
-
--
cgit v1.2.3-24-g4f1b