Total Complexity | 2 |
Total Lines | 57 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | class ReadBench |
||
9 | { |
||
10 | /** |
||
11 | * @var ByteBuffer |
||
12 | */ |
||
13 | private $buffer; |
||
14 | |||
15 | /** |
||
16 | * @return void |
||
17 | */ |
||
18 | public function init(): void |
||
19 | { |
||
20 | $this->buffer = new ByteBuffer; |
||
21 | $this->buffer |
||
22 | ->appendInt8(1) |
||
23 | ->appendInt16(1) |
||
24 | ->appendInt32(1) |
||
25 | ->appendInt64(1) |
||
26 | ->appendUint8(1) |
||
27 | ->appendUint16(1) |
||
28 | ->appendUint32(1) |
||
29 | ->appendUint64(1) |
||
30 | ->appendFloat(1.1) |
||
31 | ->appendFloat(-1.1) |
||
32 | ->appendFloat(\M_PI) |
||
33 | ->appendDouble(1.1) |
||
34 | ->appendDouble(-1.1) |
||
35 | ->appendDouble(\M_PI) |
||
36 | ->append('some string') |
||
37 | ->append("other string") |
||
38 | ; |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * @Revs(1000) |
||
43 | * @Iterations(100) |
||
44 | * |
||
45 | * @return void |
||
46 | */ |
||
47 | public function benchRead(): void |
||
65 | } |
||
66 | } |
||
67 |