Skip to content

Instantly share code, notes, and snippets.

@damiankloip
Created April 9, 2013 08:00
Show Gist options
  • Save damiankloip/5343836 to your computer and use it in GitHub Desktop.
Save damiankloip/5343836 to your computer and use it in GitHub Desktop.
<?php
$times = array();
for ($i = 0; $i <= 10; $i++) {
$view = views_get_view('frontpage');
timer_start('damian');
for ($i = 0; $i <= 100; $i++) {
$view->setDisplay('page_1');
$view->execute();
$view->destroy();
}
$timer = timer_stop('damian');
$times[] = $timer['time'];
}
dpm(array_sum($times) / count($times), 'avg');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment