summaryrefslogtreecommitdiffstats
path: root/Python/import.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-10-10 09:51:50 (GMT)
committerGitHub <noreply@github.com>2017-10-10 09:51:50 (GMT)
commita997c7b434631f51e00191acea2ba6097691e859 (patch)
tree1626ff43ab1ace99e035474b1727a08f22e65404 /Python/import.c
parent14aa00b519c827578648f2c006ad0ac8058cf6a1 (diff)
downloadcpython-a997c7b434631f51e00191acea2ba6097691e859.zip
cpython-a997c7b434631f51e00191acea2ba6097691e859.tar.gz
cpython-a997c7b434631f51e00191acea2ba6097691e859.tar.bz2
bpo-31415: Add _PyTime_GetPerfCounter() and use it for -X importtime (#3936)
* Add _PyTime_GetPerfCounter() * Use _PyTime_GetPerfCounter() for -X importtime
Diffstat (limited to 'Python/import.c')
-rw-r--r--Python/import.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/import.c b/Python/import.c
index 7554bf8..d396b4d 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -1695,7 +1695,7 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *globals,
if (ximporttime) {
import_level++;
- t1 = _PyTime_GetMonotonicClock();
+ t1 = _PyTime_GetPerfCounter();
accumulated = 0;
}
@@ -1711,7 +1711,7 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *globals,
mod != NULL);
if (ximporttime) {
- _PyTime_t cum = _PyTime_GetMonotonicClock() - t1;
+ _PyTime_t cum = _PyTime_GetPerfCounter() - t1;
import_level--;
fprintf(stderr, "import time: %9ld | %10ld | %*s%s\n",