I have the next golang code:
var c uint64;
for c = 1; c <=10000000000 ; c++ { }
When I run it, the execution time is about 26 seconds.
But for the next code that gets the same result:
c = 0
for {
c++
if c == 10000000000 {
break
}
}
the execution time is about 13 seconds. Why is that?
In C++ the elapsed time is 0 seconds. Any suggestion to improve the speed in golang?
Best regards.