1
0
mirror of synced 2024-12-13 14:56:01 +03:00
doctrine2/draft/test.php
2007-12-10 20:02:41 +00:00

21 lines
588 B
PHP

<?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);