- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 15 for IntN (0.13 sec)
-
internal/grid/benchmark_test.go
n := 0 var latency int64 managers := grid.Managers hosts := grid.Hosts for pb.Next() { // Pick a random manager. src, dst := rng.Intn(len(managers)), rng.Intn(len(managers)) if src == dst { dst = (dst + 1) % len(managers) } local := managers[src] conn := local.Connection(hosts[dst]) if conn == nil {
Go - Registered: Sun May 05 19:28:20 GMT 2024 - Last Modified: Tue Nov 21 01:09:35 GMT 2023 - 12.2K bytes - Viewed (0) -
api/go1.22.txt
pkg math/rand/v2, func Int32() int32 #61716 pkg math/rand/v2, func Int32N(int32) int32 #61716 pkg math/rand/v2, func Int64() int64 #61716 pkg math/rand/v2, func Int64N(int64) int64 #61716 pkg math/rand/v2, func IntN(int) int #61716 pkg math/rand/v2, func N[$0 intType]($0) $0 #61716 pkg math/rand/v2, func New(Source) *Rand #61716 pkg math/rand/v2, func NewChaCha8([32]uint8) *ChaCha8 #61716
Plain Text - Registered: Tue May 07 11:14:38 GMT 2024 - Last Modified: Wed Jan 24 20:54:27 GMT 2024 - 7.7K bytes - Viewed (0) -
cmd/xl-storage-format_test.go
if err != nil { b.Fatal(err) } // Update modtime for resorting... fi.ModTime = fi.ModTime.Add(-time.Second) // Update a random version. fi.VersionID = ids[rng.Intn(size)] // Update... err = xl.UpdateObjectVersion(fi) if err != nil { b.Fatal(err) } // Save... dump, err = xl.AppendTo(dump[:0]) if err != nil {
Go - Registered: Sun May 05 19:28:20 GMT 2024 - Last Modified: Thu Feb 22 06:26:06 GMT 2024 - 17.6K bytes - Viewed (0) -
cmd/local-locker_test.go
} // Expire 50% expired := time.Now().Add(-time.Hour * 2) for _, v := range l.lockMap { for i := range v { if rng.Intn(2) == 0 { v[i].TimeLastRefresh = expired } } } start = time.Now() l.expireOldLocks(time.Hour)
Go - Registered: Sun May 05 19:28:20 GMT 2024 - Last Modified: Sun Mar 05 04:57:35 GMT 2023 - 11.8K bytes - Viewed (0) -
internal/http/server.go
if err != nil { return err } pollIntervalBase := time.Millisecond nextPollInterval := func() time.Duration { // Add 10% jitter. interval := pollIntervalBase + time.Duration(rand.Intn(int(pollIntervalBase/10))) // Double and clamp for next time. pollIntervalBase *= 2 if pollIntervalBase > shutdownPollIntervalMax { pollIntervalBase = shutdownPollIntervalMax } return interval }
Go - Registered: Sun May 05 19:28:20 GMT 2024 - Last Modified: Fri Feb 09 21:25:16 GMT 2024 - 7.7K bytes - Viewed (0) -
internal/s3select/select_benchmark_test.go
func newRandString(length int) string { randSrc := rand.New(rand.NewSource(time.Now().UnixNano())) b := make([]byte, length) for i := range b { b[i] = charset[randSrc.Intn(len(charset))] } return string(b) } func genSampleCSVData(count int) []byte { buf := &bytes.Buffer{} csvWriter := csv.NewWriter(buf) csvWriter.Write([]string{"id", "name", "age", "city"})
Go - Registered: Sun May 05 19:28:20 GMT 2024 - Last Modified: Thu Apr 14 13:54:47 GMT 2022 - 5K bytes - Viewed (0) -
cmd/benchmark-utils_test.go
const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" // seeding the random number generator. rand.Seed(UTCNow().UnixNano()) // pick a character randomly. return []byte{letterBytes[rand.Intn(len(letterBytes))]} } // picks a random byte and repeats it to size bytes. func generateBytesData(size int) []byte { // repeat the random character chosen size return bytes.Repeat(getRandomByte(), size) }
Go - Registered: Sun May 05 19:28:20 GMT 2024 - Last Modified: Fri Dec 23 15:46:00 GMT 2022 - 8.2K bytes - Viewed (0) -
src/bytes/buffer_test.go
var buf Buffer s := "" for i := 0; i < 50; i++ { wlen := rand.Intn(len(testString)) if i%2 == 0 { s = fillString(t, "TestMixedReadsAndWrites (1)", &buf, s, 1, testString[0:wlen]) } else { s = fillBytes(t, "TestMixedReadsAndWrites (1)", &buf, s, 1, testBytes[0:wlen]) } rlen := rand.Intn(len(testString)) fub := make([]byte, rlen) n, _ := buf.Read(fub) s = s[n:] }
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Fri Apr 26 13:31:36 GMT 2024 - 18.6K bytes - Viewed (0) -
src/bufio/bufio_test.go
} // While not recommended, it is valid to append to a shifted buffer. // This forces Write to copy the input. if rn.Intn(8) == 0 && cap(b) > 0 { b = b[1:1:cap(b)] } // Append a random integer of varying width. n := int64(rn.Intn(1 << rn.Intn(30))) want = append(strconv.AppendInt(want, n, 10), ' ') b = append(strconv.AppendInt(b, n, 10), ' ') w.Write(b) } w.Flush()
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Fri Feb 10 18:56:01 GMT 2023 - 51.5K bytes - Viewed (0) -
src/bytes/bytes_test.go
} } } var makeFieldsInput = func() []byte { x := make([]byte, 1<<20) // Input is ~10% space, ~10% 2-byte UTF-8, rest ASCII non-space. for i := range x { switch rand.Intn(10) { case 0: x[i] = ' ' case 1: if i > 0 && x[i-1] == 'x' { copy(x[i-1:], "χ") break } fallthrough default: x[i] = 'x' } } return x
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Wed Jan 24 16:07:25 GMT 2024 - 56.2K bytes - Viewed (0)