<?
require_once('./bench/Timer.php');
mysql_connect('localhost', 'root', '');
mysql_select_db('test');
$timer = new Benchmark_Timer();
$timer->start();
echo 'start';
$timer->setMarker('START');
/*for($i = 0; $i < 1000; $i++){
if(!mysql_query('INSERT INTO zeit(id, zeitint, zeitdatumlang, zeitdatumkurz, time)
VALUES(
\'\',
\''.time().'\',
\'\',
\'\',
\'\')')){
echo mysql_error();
die('fehler!');
}
}
$timer->setMarker('Intstop');
$timer->setMarker('Tatetime start');
for($i = 0; $i < 1000; $i++){
if(!mysql_query('INSERT INTO zeit(zeitdatumlang) VALUES(NOW())')){
echo mysql_error();
die('fehler!');
}
}
$timer->setMarker('Datetime stop'); */
for($i = 0; $i < 10; $i++){
if(! $id = mysql_query('SELECT zeitint FROM zeit LIMIT 0,1000')){
echo mysql_error();
die('fehler!');
}
while($row = mysql_fetch_assoc($id)){
$zeit = date('d.m.Y', $id['zeitint']);
//echo $zeit.' ';
}
}
$timer->setMarker('Intstop');
echo '<br>';
$timer->setMarker('Tatetime start');
for($i = 0; $i < 10; $i++){
if(! $id = mysql_query('SELECT DATE_FORMAT(zeitdatumlang,\'%d.%m.%Y\') AS zeit FROM zeit LIMIT 1000,1000')){
echo mysql_error();
die('fehler!');
}
while($row = mysql_fetch_assoc($id)){
$zeit = $row['zeit'];
// echo $zeit.' ';
}
}
$timer->setMarker('Datetime stop');
$timer->setMarker('STOP');
echo 'stop';
$timer->stop();
$timer->display();
?>