Switch to using monotonic time in Database.py timing
This commit is contained in:
parent
e424e3b294
commit
f7e4d08eb0
1 changed files with 2 additions and 2 deletions
|
@ -244,13 +244,13 @@ class Database(object):
|
||||||
self.bot.events.on("log.debug").call(
|
self.bot.events.on("log.debug").call(
|
||||||
message="executing query: \"%s\" (params: %s)",
|
message="executing query: \"%s\" (params: %s)",
|
||||||
params=[printable_query, params])
|
params=[printable_query, params])
|
||||||
start = time.time()
|
start = time.monotonic()
|
||||||
|
|
||||||
cursor = self.cursor()
|
cursor = self.cursor()
|
||||||
cursor.execute(query, params)
|
cursor.execute(query, params)
|
||||||
value = fetch_func(cursor)
|
value = fetch_func(cursor)
|
||||||
|
|
||||||
end = time.time()
|
end = time.monotonic()
|
||||||
total_milliseconds = (end - start) * 1000
|
total_milliseconds = (end - start) * 1000
|
||||||
self.bot.events.on("log.debug").call(
|
self.bot.events.on("log.debug").call(
|
||||||
message="executed in %fms",
|
message="executed in %fms",
|
||||||
|
|
Loading…
Reference in a new issue