Skip to content

Commit 42085ce

Browse files
authored
Update benchmark.php
1 parent 92e6bf2 commit 42085ce

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

benchmark.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php
22

33
Class DBPerformance
44
{
@@ -18,9 +18,9 @@ public function __construct($dbname, $host, $username, $password = '')
1818
$this->db = new PDO('mysql:dbname=' . $dbname . ';host=' . $host, $username, $password);
1919
}
2020

21-
public function insertBenchmark()
21+
public function insertBenchmark($time = 5000)
2222
{
23-
$this->setStartTime(5000);
23+
$this->setStartTime($time);
2424
$this->setCounter(1);
2525

2626
while ($this->startTime - (microtime(1) * 1000) > 0)
@@ -34,9 +34,9 @@ public function insertBenchmark()
3434
}
3535
}
3636

37-
public function selectBenchmark()
37+
public function selectBenchmark($time = 5000)
3838
{
39-
$this->setStartTime(5000);
39+
$this->setStartTime($time);
4040
$this->setCounter(1);
4141

4242
while ($this->startTime - (microtime(1) * 1000) > 0)
@@ -51,9 +51,9 @@ public function selectBenchmark()
5151
}
5252
}
5353

54-
public function updateBenchmark()
54+
public function updateBenchmark($time = 5000)
5555
{
56-
$this->setStartTime(5000);
56+
$this->setStartTime($time);
5757
$this->setCounter(1);
5858

5959
while ($this->startTime - (microtime(1) * 1000) > 0)
@@ -117,10 +117,10 @@ private function getRTime($sumTime, $totalTime)
117117
{
118118
$newTime = $sumTime / $totalTime;
119119
if ($newTime >= 0.001) {
120-
return round($newTime * 1000) . ' MiliSecond';
120+
return round($newTime * 1000) . ' MiliSaniye';
121121
}
122122

123-
return round($newTime * 1000 * 1000) . ' MicroSecond';
123+
return round($newTime * 1000 * 1000) . ' MikroSaniye';
124124
}
125125

126126
}

0 commit comments

Comments
 (0)