benchmark-postgres-mongo icon indicating copy to clipboard operation
benchmark-postgres-mongo copied to clipboard

Use time.Since()

Open cn0047 opened this issue 6 years ago • 0 comments

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.

cn0047 avatar Mar 14 '19 22:03 cn0047