Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for Reset (0.12 sec)

  1. src/bytes/buffer_test.go

    	buf := NewBuffer(make([]byte, n))
    	for i := 0; i < b.N; i++ {
    		buf.Reset()
    		for i := 0; i < n; i++ {
    			buf.WriteByte('x')
    		}
    	}
    }
    
    func BenchmarkWriteRune(b *testing.B) {
    	const n = 4 << 10
    	const r = '☺'
    	b.SetBytes(int64(n * utf8.RuneLen(r)))
    	buf := NewBuffer(make([]byte, n*utf8.UTFMax))
    	for i := 0; i < b.N; i++ {
    		buf.Reset()
    		for i := 0; i < n; i++ {
    			buf.WriteRune(r)
    		}
    	}
    }
    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)
  2. doc/next/6-stdlib/1-time.md

    now unbuffered, with capacity 0.
    The main effect of this change is that Go now guarantees
    that for any call to a `Reset` or `Stop` method, no stale values
    prepared before that call will be sent or received after the call.
    Earlier versions of Go used channels with a one-element buffer,
    making it difficult to use `Reset` and `Stop` correctly.
    A visible effect of this change is that `len` and `cap` of timer channels
    Plain Text
    - Registered: Tue May 07 11:14:38 GMT 2024
    - Last Modified: Fri Apr 12 20:57:18 GMT 2024
    - 1.5K bytes
    - Viewed (0)
  3. doc/godebug.md

    ### Go 1.23
    
    Go 1.23 changed the channels created by package time to be unbuffered
    (synchronous), which makes correct use of the [`Timer.Stop`](/pkg/time/#Timer.Stop)
    and [`Timer.Reset`](/pkg/time/#Timer.Reset) method results much easier.
    The [`asynctimerchan` setting](/pkg/time/#NewTimer) disables this change.
    There are no runtime metrics for this change,
    Plain Text
    - Registered: Tue May 07 11:14:38 GMT 2024
    - Last Modified: Tue Apr 16 17:29:58 GMT 2024
    - 13.5K bytes
    - Viewed (0)
  4. src/archive/tar/tar_test.go

    				tw.WriteHeader(file.hdr)
    				tw.Write(file.body)
    			}
    			tw.Close()
    			b.Run(v.label, func(b *testing.B) {
    				b.ReportAllocs()
    				// Read from the byte buffer.
    				for i := 0; i < b.N; i++ {
    					r.Reset(buf.Bytes())
    					tr := NewReader(&r)
    					if _, err := tr.Next(); err != nil {
    						b.Errorf("unexpected Next error: %v", err)
    					}
    					if _, err := io.Copy(io.Discard, tr); err != nil {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Fri Mar 15 16:01:50 GMT 2024
    - 24K bytes
    - Viewed (0)
Back to top