PHP code example of mathisburger / phpunit-stopwatch
1. Go to this page and download the library: Download mathisburger/phpunit-stopwatch library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mathisburger / phpunit-stopwatch example snippets
class SomeTest extends \MathisBurger\PhpUnitStopwatch\StopwatchTestCase
{
public function testSomething(): void
{
$this->runPerformanceTest(function () {
sleep(2);
});
// Is successful
$this->assertExecutionTimeBelow(3000);
}
}