@@ -411,7 +411,8 @@ Miscellaneous options
|
411 | 411 | * ``-X importtime`` to show how long each import takes. It shows module name, |
412 | 412 | cumulative time (including nested imports) and self time (exluding nested |
413 | 413 | imports). Note that its output may be broken in multi threaded application. |
414 | | - Typical usage is ``python3 -X importtime -c 'import asyncio'``. |
| 414 | + Typical usage is ``python3 -X importtime -c 'import asyncio'``. See also |
| 415 | +:envvar:`PYTHONPROFILEIMPORTTIME`. |
415 | 416 | |
416 | 417 | It also allows passing arbitrary values and retrieving them through the |
417 | 418 | :data:`sys._xoptions` dictionary. |
@@ -429,7 +430,7 @@ Miscellaneous options
|
429 | 430 | The ``-X showalloccount`` option. |
430 | 431 | |
431 | 432 | .. versionadded:: 3.7 |
432 | | - The ``-X importtime`` option. |
| 433 | + The ``-X importtime`` and :envvar:`PYTHONPROFILEIMPORTTIME` options. |
433 | 434 | |
434 | 435 | |
435 | 436 | Options you shouldn't use |
@@ -650,6 +651,15 @@ conflict.
|
650 | 651 | .. versionadded:: 3.4 |
651 | 652 | |
652 | 653 | |
| 654 | +.. envvar:: PYTHONPROFILEIMPORTTIME |
| 655 | + |
| 656 | + If this environment variable is set to a non-empty string, Python will |
| 657 | + show how long each import takes. This is exactly equivalent to setting |
| 658 | + ``-X importtime`` on the command line. |
| 659 | + |
| 660 | + .. versionadded:: 3.7 |
| 661 | + |
| 662 | + |
653 | 663 | .. envvar:: PYTHONASYNCIODEBUG |
654 | 664 | |
655 | 665 | If this environment variable is set to a non-empty string, enable the |
|