同一台机器
go:
```go
package main
import "fmt"
func main() {
var a int32
var b int32
for a=0;a<100000000;a++ {
for b=0;b<1000;b++{
}
}
fmt.Println("OK")
}
```
```bash
[root@centoss8 test1]# time ./test
OK
real 0m35.566s
user 0m34.522s
sys 0m0.025s
```
c:
```c
int main()
{
int a,b;
for(a=0; a<100000000; a++)
for(b=0; b<1000; b++){
}
printf("OK");
}
```
```bash
[root@centoss8 ctest]# time ./test1
OK
real 3m30.096s
user 3m23.612s
sys 0m0.112s
```
有疑问加站长微信联系(非本文作者)