summaryrefslogtreecommitdiffstats
path: root/Include
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 /Include
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 'Include')
-rw-r--r--Include/pytime.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/Include/pytime.h b/Include/pytime.h
index 87ac7fc..95d482f 100644
--- a/Include/pytime.h
+++ b/Include/pytime.h
@@ -192,6 +192,22 @@ PyAPI_FUNC(int) _PyTime_localtime(time_t t, struct tm *tm);
Return 0 on success, raise an exception and return -1 on error. */
PyAPI_FUNC(int) _PyTime_gmtime(time_t t, struct tm *tm);
+#ifdef MS_WINDOWS
+PyAPI_FUNC(int) _PyTime_GetWinPerfCounterWithInfo(
+ _PyTime_t *t,
+ _Py_clock_info_t *info);
+#endif
+
+/* Get the performance counter: clock with the highest available resolution to
+ measure a short duration. */
+PyAPI_FUNC(_PyTime_t) _PyTime_GetPerfCounter(void);
+
+/* Similar to _PyTime_GetPerfCounter(),
+ but get also clock info if info is non-NULL. */
+PyAPI_FUNC(int) _PyTime_GetPerfCounterWithInfo(
+ _PyTime_t *t,
+ _Py_clock_info_t *info);
+
#ifdef __cplusplus
}
#endif