func doIncr (id string, signal chan int, client redis.Client, cnt int) { key := "ctr-" + id; for i:=0;i<cnt;i++ { client.Incr(key); } signal <- 1; }
func doIncr(client redis.Client, cnt int) (delta int64) { key := "ctr" t0 := time.Nanoseconds() for i := 0; i < cnt; i++ { client.Incr(key) } delta = time.Nanoseconds() - t0 client.Flushdb() return }
func doIncr(client redis.Client, cnt int) (delta time.Duration) { key := "ctr" t0 := time.Now() for i := 0; i < cnt; i++ { client.Incr(key) } delta = time.Now().Sub(t0) client.Flushdb() return }