-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathkv-memcache.inc
More file actions
38 lines (31 loc) · 875 Bytes
/
kv-memcache.inc
File metadata and controls
38 lines (31 loc) · 875 Bytes
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
<?php
/**
* php safe options - only tests mod memcache
* Php 5.0+
*/
/** ---------------------------------- Tests functions -------------------------------------------- */
// ------------------------- INTL tests -----------------------
/**
* @since 5.0
*/
function test_39_05_kvstorage_memcache()
{
global $testsLoopLimits, $totalOps, $emptyResult;
if (!is_file('kvstorage-memcache.inc')){
return $emptyResult;
}
include_once('kvstorage-memcache.inc');
if (!$kvstorage->available){
return $emptyResult;
}
$count = $testsLoopLimits['39_05_kvstorage_memcache'];
$time_start = get_microtime();
for ($i = 0; $i < $count; $i++) {
$num = $i / 100.;
$kvstorage->set($i, $num);
$v=$kvstorage->get($i);
if ($v===$num) $kvstorage->del($i);
}
$totalOps += $count;
return format_result_test(get_microtime() - $time_start, $count, mymemory_usage());
}