I have a mongodb database, I want to count how long it takes to query the database. my code so far:
from pymongo import MongoClient
import time
client = MongoClient('mongodb://localhost:27017') # open connection
db = client.customer
start = time.time()
# query data mongo
q = db.atweetdata.find()
stop = time.time()-start
print(stop)
The result shows 0.0
. It might because the time is so sort/fast or something.
How to count the process more specific to nanosecond? Thanks