fixed typo in security checks for prescription access
[openemr.git] / library / adodb / tests / benchmark.php
blob53636cbf45d43b0afcf78b7898029faa94cc9bf8
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
3 <html>
4 <head>
5 <title>ADODB Benchmarks</title>
6 </head>
8 <body>
9 <?php
11 V4.20 22 Feb 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
12 Released under both BSD license and Lesser GPL library license.
13 Whenever there is any discrepancy between the two licenses,
14 the BSD license will take precedence.
16 Benchmark code to test the speed to the ADODB library with different databases.
17 This is a simplistic benchmark to be used as the basis for further testing.
18 It should not be used as proof of the superiority of one database over the other.
19 */
21 $testmssql = true;
22 //$testvfp = true;
23 $testoracle = true;
24 $testado = true;
25 $testibase = true;
26 $testaccess = true;
27 $testmysql = true;
28 $testsqlite = true;;
30 set_time_limit(240); // increase timeout
32 include("../tohtml.inc.php");
33 include("../adodb.inc.php");
35 function testdb(&$db,$createtab="create table ADOXYZ (id int, firstname char(24), lastname char(24), created date)")
37 GLOBAL $ADODB_version,$ADODB_FETCH_MODE;
39 adodb_backtrace();
41 $max = 100;
42 $sql = 'select * from ADOXYZ';
43 $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
45 //print "<h3>ADODB Version: $ADODB_version Host: <i>$db->host</i> &nbsp; Database: <i>$db->database</i></h3>";
47 // perform query once to cache results so we are only testing throughput
48 $rs = $db->Execute($sql);
49 if (!$rs){
50 print "Error in recordset<p>";
51 return;
53 $arr = $rs->GetArray();
54 //$db->debug = true;
55 global $ADODB_COUNTRECS;
56 $ADODB_COUNTRECS = false;
57 $start = microtime();
58 for ($i=0; $i < $max; $i++) {
59 $rs =& $db->Execute($sql);
60 $arr =& $rs->GetArray();
61 // print $arr[0][1];
63 $end = microtime();
64 $start = explode(' ',$start);
65 $end = explode(' ',$end);
67 //print_r($start);
68 //print_r($end);
70 // print_r($arr);
71 $total = $end[0]+trim($end[1]) - $start[0]-trim($start[1]);
72 printf ("<p>seconds = %8.2f for %d iterations each with %d records</p>",$total,$max, sizeof($arr));
73 flush();
76 //$db->Close();
78 include("testdatabases.inc.php");
83 </body>
84 </html>