Version: current

# Class Profiler

Execution time profiler.

Package: sapphire\misc
Located at sapphire/profiler/Profiler.php

## Methods summary

`public` | # `Profiler( mixed $output_enabled = false, mixed $trace_enabled = false )` Initialise the timer. with the current micro time Initialise the timer. with the current micro time
`public static` | # `init( )`
`public static` | # `mark( mixed $name, mixed $level2 = "", mixed $desc = "" )`
`public static` | # `unmark( mixed $name, mixed $level2 = "", mixed $desc = "" )`
`public static` | # `show( mixed $showTrace = false )`
`public` | # `startTimer( string $name, string $desc = "" )` Start an individual timer This will pause the running timer and place it on a stack. Start an individual timer This will pause the running timer and place it on a stack. #### Parameters $name string $name name of the timer $desc string optional $desc description of the timer
`public` | # `stopTimer( string $name )` Stop an individual timer Restart the timer that was running before this one Stop an individual timer Restart the timer that was running before this one #### Parameters $name string $name name of the timer
`public` | # `elapsedTime( mixed $name )` measure the elapsed time of a timer without stoping the timer if it is still running 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 Measure the elapsed time since the profile class was initialised
`public` | # `printTimers( mixed $enabled = false )` print out a log of all the timers that were registered print out a log of all the timers that were registered
`public` | # `printTrace( mixed $enabled = false )`
`public` | # `getMicroTime( )` Get the current time as accuratly as possible Get the current time as accuratly as possible
`public` | # `__resumeTimer( mixed $name )` resume an individual timer resume an individual timer
`public` | # `__suspendTimer( mixed $name )` suspend an individual timer suspend an individual timer

### Magic methods summary

## Properties summary

`public mixed` | $description | #
`public mixed` | $startTime | #
`public mixed` | $endTime | #
`public mixed` | $initTime | #
`public mixed` | $cur_timer | #
`public mixed` | $stack | #
`public mixed` | $trail | #
`public mixed` | $trace | #
`public mixed` | $count | #
`public mixed` | $running | #
`protected static mixed` | $inst | #

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -