You are here

function _authcache_dev_query in Authenticated User Page Caching (Authcache) 7

Same name and namespace in other branches
  1. 6 ajax/authcache.php \_authcache_dev_query()

Database benchmarks for Authcache Ajax phase

1 call to _authcache_dev_query()
authcache.php in ajax/authcache.php
Authcache Ajax Callback (authcache.php)

File

ajax/authcache.php, line 339
Authcache Ajax Callback (authcache.php)

Code

function _authcache_dev_query() {
  global $queries;
  if (!$queries) {
    return;
  }
  $time_query = 0;
  foreach ($queries as $q) {
    $time_query += $q[1];
  }
  $time_query = round($time_query * 1000, 2);

  // Convert seconds to milliseconds
  $percent_query = round($time_query / timer_read('page') * 100);
  return count($queries) . " queries @ {$time_query} ms";
}