import ( "fmt" "runtime" "time" ) func GetCPUCount() { print("GOOS:", runtime.GOOS, "\n") print("GOARCH:", runtime.GOARCH, "\n") print("NumCPU:", fmt.Sprintf("%d", runtime.NumCPU()), "\n")} func perfTest(c chan bool, n int) { x := 0 for i := 0; i < 100000000; i++ { x += i } println(n, " ", x) if n == 9 { c <- true } } func PerfTest() { GetCPUCount() println("start") t1 := time.Now() c := make(chan bool) for i := 0; i < 10; i++ { go perfTest(c, i) } <-c println("done, ", time.Now().Sub(t1).String()) }
root@Witi:/mnt/sda1# ./startMIPSTestGOOS:linux GOARCH:mipso32 NumCPU:4 start 0 887459712 1 887459712 5 887459712 2 887459712 4 887459712 3 887459712 8 887459712 9 887459712 done, 9.848502s root@Witi:/mnt/sda1#
root@Witi:/mnt/sda1# cat /proc/cpuinfo
system type : MT7621
machine : Witi
processor : 0
cpu model : MIPS 1004Kc V2.15
BogoMIPS : 583.68
wait instruction : yes
microsecond timers : yes
tlb_entries : 32
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc,
0x0ffb, 0x0ffb]
isa : mips1 mips2 mips32r1 mips32r2
ASEs implemented : mips16 dsp mt
shadow register sets : 1
kscratch registers : 0
core : 0
VPE : 0
VCED exceptions : not available
VCEI exceptions : not available
processor : 1
cpu model : MIPS 1004Kc V2.15
BogoMIPS : 583.68
wait instruction : yes
microsecond timers : yes
tlb_entries : 32
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc,
0x0ffb, 0x0ffb]
isa : mips1 mips2 mips32r1 mips32r2
ASEs implemented : mips16 dsp mt
shadow register sets : 1
kscratch registers : 0
core : 0
VPE : 1
VCED exceptions : not available
VCEI exceptions : not available
processor : 2
cpu model : MIPS 1004Kc V2.15
BogoMIPS : 583.68
wait instruction : yes
microsecond timers : yes
tlb_entries : 32
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc,
0x0ffb, 0x0ffb]
isa : mips1 mips2 mips32r1 mips32r2
ASEs implemented : mips16 dsp mt
shadow register sets : 1
kscratch registers : 0
core : 1
VPE : 0
VCED exceptions : not available
VCEI exceptions : not available
processor : 3
cpu model : MIPS 1004Kc V2.15
BogoMIPS : 583.68
wait instruction : yes
microsecond timers : yes
tlb_entries : 32
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc,
0x0ffb, 0x0ffb]
isa : mips1 mips2 mips32r1 mips32r2
ASEs implemented : mips16 dsp mt
shadow register sets : 1
kscratch registers : 0
core : 1
VPE : 1
VCED exceptions : not available
VCEI exceptions : not available
--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/Jz2QK2hvCac/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.