Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit 14377b3

Browse files
committed
Merge pull request #61 from romainneutron/patch-1
Check for bcmath before calculing PI
2 parents 39c7b22 + 3f3b883 commit 14377b3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/ZendDiagnostics/Check/CpuPerformance.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,18 @@ public function __construct($minPerformance = 0.5)
7272
*/
7373
public function check()
7474
{
75-
$timeStart = microtime(true);
76-
$result = static::calcPi(1000);
77-
$duration = microtime(true) - $timeStart;
78-
$performance = $duration / $this->baseline;
79-
8075
// Check if bcmath extension is present
8176
// @codeCoverageIgnoreStart
8277
if (!extension_loaded('bcmath')) {
8378
return new Warning('Check\CpuPerformance requires BCMath extension to be loaded.');
8479
}
8580
// @codeCoverageIgnoreEnd
8681

82+
$timeStart = microtime(true);
83+
$result = static::calcPi(1000);
84+
$duration = microtime(true) - $timeStart;
85+
$performance = $duration / $this->baseline;
86+
8787
if ($result != $this->expectedResult) {
8888
// Ignore code coverage here because it's impractical to test against faulty calculations.
8989
// @codeCoverageIgnoreStart

0 commit comments

Comments
 (0)