Example #1
0
func doSadd(client redis.Client, cnt int) (delta int64) {
	key := "set"
	value := strings.Bytes("one")
	t0 := time.Nanoseconds()
	for i := 0; i < cnt; i++ {
		client.Sadd(key, value)
	}
	delta = time.Nanoseconds() - t0
	client.Flushdb()
	return
}
Example #2
0
func doSadd(client redis.Client, cnt int) (delta time.Duration) {
	key := "set"
	value := []byte("one")
	t0 := time.Now()
	for i := 0; i < cnt; i++ {
		client.Sadd(key, value)
	}
	delta = time.Now().Sub(t0)
	client.Flushdb()
	return
}