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