Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $time_start = microtime(true);
- $c = $modx->newQuery('modResource');
- $c->select(array('id','pagetitle'));
- $c->where(array('id:<' => 1000));
- for ($i = 1000; $i >= 0; $i--) {
- if($c->prepare() && $c->stmt->execute()) {
- $collection = $c->stmt->fetchAll(PDO::FETCH_ASSOC);
- }
- $x = array();
- foreach ($collection as $key => $value) {
- $x[] = $value;
- }
- }
- $time_end = microtime(true);
- $time = $time_end - $time_start;
- echo $time;
- echo '<br />';
- $time_start = microtime(true);
- for ($i = 1000; $i >= 0; $i--) {
- $collection = $modx->getCollection('modResource',$c);
- foreach ($collection as $key => $value) {
- $value->toArray();
- }
- }
- $time_end = microtime(true);
- $time = $time_end - $time_start;
- echo $time;
- die('<br />Закончили');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement