benchmark-postgres-mongo
benchmark-postgres-mongo copied to clipboard
Use time.Since()
In src/benchmark/main.go replace:
startedAt := time.Now().UnixNano()
f()
finishedAt := time.Now().UnixNano()
fmt.Printf("Action: %s, took: %d microseconds \n\n", actionName, (finishedAt - startedAt) / 1000)
with using time.Since function.