Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $time = 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);
- }
- foreach ($collection as $key => $value) {
- echo '<pre>';
- //print_r($value);
- echo '</pre>';
- }
- }
- echo microtime(true) - $time;
- $time = microtime(true);
- for ($i = 1000; $i >= 0; $i--) {
- $collection = $modx->getCollection('modResource',$c);
- foreach ($collection as $key => $value) {
- echo '<pre>';
- //print_r($value->toArray());
- echo '</pre>';
- }
- }
- echo microtime(true) - $time;die;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement