diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-06-24 19:47:52 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-06-24 21:16:58 -0400 |
commit | 003333f0612562f2d97aa9090795dc0801779b5a (patch) | |
tree | 59d5209a6b0e5b2e2c3ca51c55d6d4f0cdbbed1c /lib/sqlalchemy/engine/default.py | |
parent | 660a340bff8fcefd2826032e75210c0924a2335e (diff) | |
download | sqlalchemy-003333f0612562f2d97aa9090795dc0801779b5a.tar.gz |
Use time.perf_counter() for cache time measurement
See https://twitter.com/raymondh/status/1275937373080023040
Change-Id: Iaa0abb0c433ccedfbd88d00e3970120242ba379b
Diffstat (limited to 'lib/sqlalchemy/engine/default.py')
-rw-r--r-- | lib/sqlalchemy/engine/default.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/sqlalchemy/engine/default.py b/lib/sqlalchemy/engine/default.py index 1a8dbb4cd..cef719498 100644 --- a/lib/sqlalchemy/engine/default.py +++ b/lib/sqlalchemy/engine/default.py @@ -16,7 +16,6 @@ as the base class for their own corresponding classes. import codecs import random import re -import time import weakref from . import cursor as _cursor @@ -1027,7 +1026,7 @@ class DefaultExecutionContext(interfaces.ExecutionContext): if self.compiled is None: return "raw sql" - now = time.time() + now = util.perf_counter() if self.compiled.cache_key is None: return "no key %.5fs" % (now - self.compiled._gen_time,) elif self.cache_hit: |