1
0
mirror of synced 2025-03-01 02:13:19 +03:00
doctrine2/draft/test.php

21 lines
588 B
PHP
Raw Normal View History

2007-12-10 20:02:41 +00:00
<?php
require_once 'Doctrine.php';
spl_autoload_register(array('Doctrine', 'autoload'));
$n = 1000;
$start = microtime(true);
for ($i = 0; $i < $n; $i++) {
/* $parser = new Doctrine_Query_Parser('SELECT u.name, u.age FROM User u WHERE u.id = ?');
$parser->parse();*/
$scanner = new Doctrine_Query_Scanner('SELECT u.name, u.age FROM User u WHERE u.id = ?');
do {
$token = $scanner->scan();
} while ($token['type'] !== Doctrine_Query_Token::T_EOS);
}
$end = microtime(true);
printf("Parsed %d queries: %.3f ms per query\n", $n, ($end - $start) / $n * 1000);