-
-
Notifications
You must be signed in to change notification settings - Fork 133
Expand file tree
/
Copy pathExampleAssertionsBench.php
More file actions
51 lines (47 loc) · 1.24 KB
/
Copy pathExampleAssertionsBench.php
File metadata and controls
51 lines (47 loc) · 1.24 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
namespace PhpBench\Examples\Assertion;
// section: all
class ExampleAssertionsBench
{
// endsection: all
// section: bench_time
/**
* @Assert("mode(variant.time.avg) < 200 microseconds +/- 10%")
*/
public function benchTime(): void
{
usleep(100);
}
// endsection: bench_time
// section: bench_time_baseline
/**
* @Assert("mode(variant.time.avg) < mode(baseline.time.avg) +/- 10%")
*/
public function benchTimeBaseline(): void
{
usleep(100);
}
// endsection: bench_time_baseline
// section: data_access
/**
* @Assert("mode(variant.time.avg) < 10")
* @Assert("mode(variant.time.net) < 10")
* @Assert("mode(variant.mem.peak) < 10")
* @Assert("mode(variant.mem.final) < 10")
* @Assert("mode(variant.mem.real) < 10")
*
* @Assert("mode(baseline.time.net) < 10")
* @Assert("mode(baseline.time.avg) < 10")
* @Assert("mode(baseline.mem.peak) < 10")
* @Assert("mode(baseline.mem.final) < 10")
* @Assert("mode(baseline.mem.real) < 10")
*/
// endsection: data_access
public function benchDataExamples(): void
{
usleep(100);
}
// endsection: bench_time
// section: all
}
// endsection: all