Class Profiler

Description

This class allows for intelligent profling.

Usage:

  1.     Profiler::enable();       // Enable profiler
  2.     ...
  3.     Profiler::start('Foo');   // Start stopwatch for item 'Foo'
  4.     Profiler::stop('Foo');    // Stop stopwatch for item 'Foo'
  5.     ...
  6.     Profiler::start('Foo');   // Start stopwatch for item 'Foo'
  7.     Profiler::start('Bar');   // Start stopwatch for item 'Bar'
  8.     Profiler::stop('Bar');    // Stop stopwatch for item 'Bar'
  9.     Profiler::stop('Foo');    // Stop stopwatch for item 'Foo'
  10.     ...
  11.     Profiler::results();      // Print results

Result:

  • id - Name of the measured item.
  • calls - Number of starts of stopwatch for item.
  • sumall - Total time spent on item (including 'recursive calls', i.e. when stopwatch is started for item that is already started).
  • sum - Total time spent on item (excluding 'recursive calls').
  • max - Maximum time spent on item.
  • min - Minimum time spent on item.
  • avg - Average time spent on item.

Located in /aclbit.php (line 1924)


	
			
Method Summary
static void disable ()
static void enable ()
static void formatTime ( $time)
static void microtime ()
static void printMeasure ( $id,  $template)
static void results ([ $tpl = "{id}({calls}): {sum}:{avg}:{max}:{min}\n"])
static void start ( $id)
static void stop ( $id)
Methods
static method disable (line 1945)

Disables profiler.

  • access: public
static void disable ()
static method enable (line 1938)

Enables profiler.

  • access: public
static void enable ()
static method formatTime (line 2018)

Formats time for output.

  • access: public
static void formatTime ( $time)
  • $time
static method microtime (line 1952)

Returns current times as float.

  • access: public
static void microtime ()
static method printMeasure (line 2025)

Outputs results for item $id.

  • access: public
static void printMeasure ( $id,  $template)
  • $id
  • $template
static method results (line 2045)

Prints profiler results.

  • access: public
static void results ([ $tpl = "{id}({calls}): {sum}:{avg}:{max}:{min}\n"])
  • $tpl
static method start (line 1960)

Starts stopwatch for item $id.

  • access: public
static void start ( $id)
  • $id
static method stop (line 1983)

Stops stopwatch for item $id.

  • access: public
static void stop ( $id)
  • $id

Documentation generated on Wed, 30 Apr 2008 08:38:21 +0200 by phpDocumentor 1.4.0