Simple demonstration to compare go and php language execution time by using for loop with one billion times loop.
package main
import (
"fmt"
"time"
)
func main() {
var n int = 0
now := time.Now()
defer func() {
fmt.Println(n)
fmt.Println(time.Now().Sub(now))
}()
for i := 0; i < 1000000000; i++ {
n += 1
}
}
<?php
$timeStart = microtime(true);
$n = 0;
for ($i = 1; $i <= 1000000000; $i++) {
$n += 1;
}
$timeEnd = microtime(true);
echo $n . "\n";
echo ($timeEnd - $timeStart) . " Secs\n";