摘要: package mainimport ( "fmt" "runtime")var slice []intfunc main() { array := make([]int, 0) for i := 0; i < 100; i++ { array = append(array, i) } np := runtime.NumCPU() n := len(array) for i := 0; i < np; i++ { slice := array[i*n/np : (i+1)*n/np] fmt.Println(slice) }}结果其中 for 阅读全文
posted @ 2013-07-09 15:34 forrestsun 阅读(302) 评论(0) 推荐(0) 编辑