package main import ( "math/rand" "sort" "testing" ) var n = 600000000 var seq = make([]int, n) func TestRandomSeq(t *testing.T) { for i := 0; i < n; i++ { seq[i] = rand.Int() } } func TestSort(t *testing.T) { sort.Ints(seq) } /** Sorting 600,000,000 random integers On MacBook Pro (Retina, 15-inch, Mid 2015), 2.8 GHz Intel Core i7, 16 GB 1600 MHz DDR3 $ go test -v sort_test.go === RUN TestRandomSeq --- PASS: TestRandomSeq (13.52s) === RUN TestSort --- PASS: TestSort (164.81s) PASS ok command-line-arguments 178.820s */