40 lines
692 B
Go
40 lines
692 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
"os"
|
|
"strings"
|
|
"sync"
|
|
"time"
|
|
|
|
go_benchmark "gitea.urkob.com/urko/ess-etl-go/benchmark/go"
|
|
nest_benchmark "gitea.urkob.com/urko/ess-etl-go/benchmark/nest"
|
|
)
|
|
|
|
func main() {
|
|
log.SetFlags(log.Lmicroseconds)
|
|
logFileName := fmt.Sprintf("%s.txt", time.Now().Format(strings.ReplaceAll(time.RFC1123Z, ":", "_")))
|
|
f, err := os.OpenFile("./dump/"+logFileName, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0o644)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
|
|
defer f.Close()
|
|
log.SetOutput(f)
|
|
|
|
wg := &sync.WaitGroup{}
|
|
wg.Add(2)
|
|
|
|
go func() {
|
|
defer wg.Done()
|
|
go_benchmark.Benchmark()
|
|
}()
|
|
go func() {
|
|
defer wg.Done()
|
|
nest_benchmark.Benchmark()
|
|
}()
|
|
|
|
wg.Wait()
|
|
}
|