Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for ExampleDuration_Round (0.29 sec)

  1. src/time/example_test.go

    	"fmt"
    	"time"
    )
    
    func expensiveCall() {}
    
    func ExampleDuration() {
    	t0 := time.Now()
    	expensiveCall()
    	t1 := time.Now()
    	fmt.Printf("The call took %v to run.\n", t1.Sub(t0))
    }
    
    func ExampleDuration_Round() {
    	d, err := time.ParseDuration("1h15m30.918273645s")
    	if err != nil {
    		panic(err)
    	}
    
    	round := []time.Duration{
    		time.Nanosecond,
    		time.Microsecond,
    		time.Millisecond,
    		time.Second,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 13 01:05:00 UTC 2024
    - 22.4K bytes
    - Viewed (0)
Back to top