-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.php
More file actions
34 lines (28 loc) · 1.32 KB
/
example.php
File metadata and controls
34 lines (28 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
defined('BASE_PATH') or define('BASE_PATH', __DIR__ . '/src');
require_once("vendor/autoload.php");
// Use a prepared test template
$speedy = new \speedy\Speedy();
print $speedy->runTestByName(\speedy\lists\TestList::PHP_ARR_SORT);
// Use custom functions
$pref = function ($size) {
$testCounter = 0;
for ($i = 0; $i < $size; $i++) {
++$testCounter; ++$testCounter; ++$testCounter; ++$testCounter; ++$testCounter; ++$testCounter;
++$testCounter; ++$testCounter; ++$testCounter; ++$testCounter; ++$testCounter; ++$testCounter;
++$testCounter; ++$testCounter; ++$testCounter; ++$testCounter; ++$testCounter; ++$testCounter;
++$testCounter; ++$testCounter; ++$testCounter; ++$testCounter; ++$testCounter; ++$testCounter;
}
};
$post = function ($size) {
$testCounter = 0;
for ($i = 0; $i < $size; $i++) {
$testCounter++; $testCounter++; $testCounter++; $testCounter++; $testCounter++; $testCounter++;
$testCounter++; $testCounter++; $testCounter++; $testCounter++; $testCounter++; $testCounter++;
$testCounter++; $testCounter++; $testCounter++; $testCounter++; $testCounter++; $testCounter++;
$testCounter++; $testCounter++; $testCounter++; $testCounter++; $testCounter++; $testCounter++;
}
};
print \speedy\Speedy::compare(['pref' => $pref, 'post' => $post]);