Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $starttime = microtime(true);
- $username = 'root';
- $password = '';
- $dsn = 'mysql:host=127.0.0.1;port=3306;dbname=test';
- $db = new PDO($dsn, $username, $password);
- for ($i = 0; $i < 1000; $i++)
- {
- $db->query('INSERT INTO test (woot) VALUE (' . microtime(true) . ')');
- }
- echo microtime(true) - $starttime;
- echo PHP_EOL;
- $starttime = microtime(true);
- $statement = $db->prepare('INSERT INTO test (woot) VALUE (?)');
- for ($i = 0; $i < 1000; $i++)
- {
- $statement->execute(array(microtime(true)));
- }
- echo microtime(true) - $starttime;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement