Skip to content

Instantly share code, notes, and snippets.

@qianbin
Created May 28, 2019 08:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qianbin/5476aae33752927618bc5718179fa253 to your computer and use it in GitHub Desktop.
Save qianbin/5476aae33752927618bc5718179fa253 to your computer and use it in GitHub Desktop.
for {
t := time.Now().UnixNano()
for i := 0; i < 1000; i++ {
var key [2]byte
rand.Read(key[:])
it := mainDB.NewIterator(*kv.NewRangeWithBytesPrefix(key[:]))
if it.Next() {
it.Value()
}
it.Release()
}
fmt.Println(time.Duration(time.Now().UnixNano() - t))
select {
case <-exitSignal.Done():
return nil
default:
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment