cn0047 / benchmark-postgres-mongo

Benchmarking read performance of PostgreSQL and MongoDB on same data sets.
https://medium.com/hackernoon/https-medium-com-cn007b-postgresql-vs-mongodb-6d8bdb7c1697
16 stars 4 forks source link

Use time.Since() #3

Open cn0047 opened 5 years ago

cn0047 commented 5 years ago

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.