Measure time eval of register_block_type_assets

This commit is contained in:
“Joshua 2024-09-18 15:41:46 -04:00
parent 9d135ee2f5
commit b28fe4dc23
1 changed files with 6 additions and 0 deletions

View File

@ -8,6 +8,8 @@ use Automattic\WooCommerce\Blocks\Assets\Api as AssetApi;
use Automattic\WooCommerce\Blocks\Integrations\IntegrationRegistry;
use Automattic\WooCommerce\Admin\Features\Features;
$t = 0;
/**
* AbstractBlock class.
*/
@ -122,7 +124,11 @@ abstract class AbstractBlock {
return false;
}
$this->integration_registry->initialize( $this->block_name . '_block' );
global $t;
$s = microtime(true);
$this->register_block_type_assets();
$t += microtime(true) - $s;
error_log('register_block_type_assets ms: ' . $t);
$this->register_block_type();
add_action( 'enqueue_block_editor_assets', [ $this, 'enqueue_editor_assets' ] );
}