Skip to content

Instantly share code, notes, and snippets.

@nidble
Created September 29, 2017 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nidble/c468a0e5972c80f89b4caab20b9b82ba to your computer and use it in GitHub Desktop.
Save nidble/c468a0e5972c80f89b4caab20b9b82ba to your computer and use it in GitHub Desktop.
block.module profiling
<?php
// _block_render_blocks:
$startTime = microtime(true);
// original code:
$array = module_invoke($block->module, 'block_view', $block->delta);
$endTime = microtime(true);
$elapsed = $endTime - $startTime;
var_dump([$block->module, $block->delta, $elapsed]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment