mirror of
https://hk.gh-proxy.com/https://github.com/wp-cli/profile-command.git
synced 2025-08-21 06:38:49 +08:00
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:
commit
59b24ff04e
1 changed files with 1 additions and 1 deletions
|
@ -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 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue