diff --git a/share/tests/pdobench.php b/share/tests/pdobench.php new file mode 100644 index 0000000..c7ade44 --- /dev/null +++ b/share/tests/pdobench.php @@ -0,0 +1,48 @@ +. + */ + +$start = microtime(true); + +$dbh = new PDO('mysql:host=localhost;dbname=volkszaehler', 'vz', 'demo'); + +$attr = array(); +$attr[PDO::ATTR_CURSOR] = PDO::CURSOR_SCROLL; + +$stmt = $dbh->prepare('SELECT timestamp, value FROM data LEFT JOIN channels ON data.channel_id = channels.id WHERE channels.indicator = \'temperature\'', $attr); + +for ($i = 0; $i < 1000; $i++) { + + $stmt->execute(); + $stmt->setFetchMode(PDO::FETCH_ASSOC); + + $c = 0; + foreach($stmt as $row) { + } + +} + +echo $stmt->rowCount() . '
'; + +echo 'time: ' . round(microtime(true) - $start, 6); + +?> \ No newline at end of file diff --git a/share/tests/test.php b/share/tests/test.conf.php similarity index 100% rename from share/tests/test.php rename to share/tests/test.conf.php