- public function __construct( $name ) {
- $this->name = $name;
- // Use Profiler member variable directly to reduce overhead
- if ( Profiler::$__instance === null ) {
- Profiler::instance();
- }
- if ( !( Profiler::$__instance instanceof ProfilerStub ) ) {
- $this->enabled = true;
- Profiler::$__instance->profileIn( $this->name );
- }
- }
-
- function __destruct() {
- if ( $this->enabled ) {
- Profiler::$__instance->profileOut( $this->name );
- }
- }