class Profiler (View source)

deprecated 4.0 The Profiler class is deprecated, use third party tools like XHProf instead

Execution time profiler.

Properties

public $description
public $startTime
public $endTime
public $initTime
public $cur_timer
public $stack
public $trail
public $trace
public $count
public $running
protected static $inst

Methods

public
__construct($output_enabled = false, $trace_enabled = false)

Initialise the timer. with the current micro time

public static 
init()

No description

public static 
mark($name, $level2 = "", $desc = "")

No description

public static 
unmark($name, $level2 = "", $desc = "")

No description

public static 
show($showTrace = false)

No description

public
startTimer($name, $desc = "")

Start an individual timer This will pause the running timer and place it on a stack.

public
stopTimer($name)

Stop an individual timer Restart the timer that was running before this one

public
elapsedTime($name)

measure the elapsed time of a timer without stoping the timer if it is still running

public
elapsedOverall()

Measure the elapsed time since the profile class was initialised

public
printTimers($enabled = false)

print out a log of all the timers that were registered

public
printTrace($enabled = false)

No description

public
getMicroTime()

Get the current time as accuratly as possible

public
__resumeTimer($name)

resume an individual timer

public
__suspendTimer($name)

suspend an individual timer

Details

__construct($output_enabled = false, $trace_enabled = false)

Initialise the timer. with the current micro time

Parameters

$output_enabled
$trace_enabled

static init()

No description

static mark($name, $level2 = "", $desc = "")

No description

Parameters

$name
$level2
$desc

static unmark($name, $level2 = "", $desc = "")

No description

Parameters

$name
$level2
$desc

static show($showTrace = false)

No description

Parameters

$showTrace

startTimer($name, $desc = "")

Start an individual timer This will pause the running timer and place it on a stack.

@param string $name name of the timer

Parameters

$name
$desc

stopTimer($name)

Stop an individual timer Restart the timer that was running before this one

@param string $name name of the timer

Parameters

$name

elapsedTime($name)

measure the elapsed time of a timer without stoping the timer if it is still running

Parameters

$name

elapsedOverall()

Measure the elapsed time since the profile class was initialised

printTimers($enabled = false)

print out a log of all the timers that were registered

Parameters

$enabled

printTrace($enabled = false)

No description

Parameters

$enabled

getMicroTime()

Get the current time as accuratly as possible

__resumeTimer($name)

resume an individual timer

Parameters

$name

__suspendTimer($name)

suspend an individual timer

Parameters

$name