Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Created by PhpStorm.
- * User: yoann
- * Date: 10/10/16
- * Time: 14:28
- */
- include('includes/db.php');
- include('includes/functions.php');
- startTime("sql");
- if (!$result = $db->query($argv[1])) {
- die('There was an error running the query [' . $db->error . "]");
- }
- echo 'TIME = ' . diffTimeToMs("sql", microtime(true));
- echo "\n";
- var_dump(mysqli_fetch_assoc($result));
- echo "\n";
- startTime("sql");
- if (!$result = $db->query("SELECT `id_users` FROM test WHERE `deleted`=0 LIMIT 1000000")) {
- die('There was an error running the query [' . $db->error . "]");
- }
- echo "\n";
- $start = 0;
- while ($row = $result->fetch_assoc()) {
- $start += $row['id_users'];
- }
- echo 'TIME = ' . diffTimeToMs("sql", microtime(true));
- echo "\n";
- echo 'value = '.$start;
- echo "\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement