set('K#' . ($i + 1), $i + 1); } $t2 = gettimeofday(TRUE); echo sprintf("%d puts per second\r\n", (int)(N / ($t2 - $t1))); } define('REP', 5); $cache = new Memcache(); $cache->connect('localhost', 11211) or die ("Could not connect to memcached"); for($i = 0; $i < REP; $i++) { test($cache); } $cache->close(); ?>