-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathcompression-zlib.inc
More file actions
43 lines (34 loc) · 1.07 KB
/
compression-zlib.inc
File metadata and controls
43 lines (34 loc) · 1.07 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
<?php
/**
* php test functions for compression by zlib
* Php 4.4+
*/
/** ---------------------------------- Tests functions -------------------------------------------- */
function test_36_01_zlib_deflate_compress()
{
global $stringTest, $emptyResult, $testsLoopLimits, $totalOps, $stringTest;
if (!function_exists('gzdeflate')) {
return $emptyResult;
}
$count = $testsLoopLimits['36_01_zlib_deflate_compress'];
$time_start = get_microtime();
for ($i = 0; $i < $count; $i++) {
$r = gzdeflate($stringTest, 1);
}
$totalOps += $count;
return format_result_test(get_microtime() - $time_start, $count, mymemory_usage());
}
function test_36_02_zlib_gzip_compress()
{
global $stringTest, $emptyResult, $testsLoopLimits, $totalOps, $stringTest;
if (!function_exists('gzencode')) {
return $emptyResult;
}
$count = $testsLoopLimits['36_02_zlib_gzip_compress'];
$time_start = get_microtime();
for ($i = 0; $i < $count; $i++) {
$r = gzencode($stringTest, 1);
}
$totalOps += $count;
return format_result_test(get_microtime() - $time_start, $count, mymemory_usage());
}