mirror of
https://hk.gh-proxy.com/https://github.com/wp-cli/profile-command.git
synced 2025-08-21 06:39:02 +08:00
Count all hook calls, regardless of whether we're in a current hook
This commit is contained in:
parent
664364aac7
commit
091e94b53e
1 changed files with 1 additions and 1 deletions
|
@ -69,11 +69,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