time datetime.datetime.now ()

4

I'm doing a script where I measure the performance of a query in a database. The code is as follows:

start = datetime.datetime.now()

//CONSULTA AQUI

end = datetime.datetime.now()

print "Time taken: %s"%(end - start, )

The program returned the following result on the first query: Time taken: 0: 00: 00.000593 In another query he presented the following result: Time taken: 0: 00: 31.833141

Are the two results being given in milliseconds or seconds?

    
asked by anonymous 12.01.2017 / 18:17

1 answer

2

Only segundo(Time taken: 0:00:31.833141) is in seconds. The first one is in milliseconds.

    
12.01.2017 / 18:38