Merge pull request #29 from runcommand/hook-count

Count all hook calls, regardless of whether we're in a current hook
This commit is contained in:
Daniel Bachhuber 2016-08-26 09:21:48 -07:00 committed by GitHub
commit 59b24ff04e

View file

@ -92,11 +92,11 @@ class Logger {
* Start this logger's hook timer * Start this logger's hook timer
*/ */
public function start_hook_timer() { public function start_hook_timer() {
$this->hooks['count']++;
// Timer already running means a subhook has been called // Timer already running means a subhook has been called
if ( ! is_null( $this->hook_start_time ) ) { if ( ! is_null( $this->hook_start_time ) ) {
$this->hook_depth++; $this->hook_depth++;
} else { } else {
$this->hooks['count']++;
$this->hook_start_time = microtime( true ); $this->hook_start_time = microtime( true );
} }
} }