Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for utime (0.15 sec)

  1. doc/go1.22.html

      requires deferring the <code>time.Since</code> call. For example:
    </p>
    
    <pre>
    t := time.Now()
    defer log.Println(time.Since(t)) // non-deferred call to time.Since
    tmp := time.Since(t); defer log.Println(tmp) // equivalent to the previous defer
    
    defer func() {
      log.Println(time.Since(t)) // a correctly deferred call to time.Since
    }()
    </pre>
    
    HTML
    - Registered: Tue Feb 06 11:13:10 GMT 2024
    - Last Modified: Wed Jan 31 20:51:56 GMT 2024
    - 45.6K bytes
    - Viewed (0)
  2. doc/go_mem.html

    </p>
    
    <p>
    This program starts a goroutine for every entry in the work list, but the
    goroutines coordinate using the <code>limit</code> channel to ensure
    that at most three are running work functions at a time.
    </p>
    
    <pre>
    var limit = make(chan int, 3)
    
    func main() {
    	for _, w := range work {
    		go func(w func()) {
    			limit &lt;- 1
    			w()
    			&lt;-limit
    		}(w)
    	}
    	select{}
    }
    HTML
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Mar 04 15:54:42 GMT 2024
    - 26.6K bytes
    - Viewed (0)
Back to top