Goroutine vs CoroutineGen

Goroutine (Golang):

package main

import (
	"fmt"
	"sync"
	"time"
)

func main() {
	wg := &sync.WaitGroup{}

	wg.Add(1)

	start := time.Now()

	go func() {
		defer wg.Done()
		for i := 0; i < 5000000; i++ {
			time.Sleep(time.Millisecond * 1)
		}
	}()

	wg.Wait()
	fmt.Println("Time taken: ", time.Since(start))
}

CoroutineGen (PHP Vapm):

Last updated