Debug import time or use this inside of a profiler.
Project description
Import Time
Use this module to debug your import times or to check how long a process takes.
Usage
Debug Import Times
This will print out the time it takes to import each module, but will not import them globally to your application. Please just use this function to debug times.
from importTime import debugImportTimes
debugImportTimes(["numpy", "torch", "mediapipe", "PIL"], "MainDeps")
Prints:
Time to Import MainDeps: 0.08100032806396484
Reveal Times
Can be added to your currently running application. This will print out the time it takes to import between startImport()
and endImport("moduleName")
.
```python
from importTime import startImport , endImport, startTotal, endTotal, saveCSV
startTotal()
startImport()
import numpy as np
endImport("numpy")
startImport()
import torch
endImport("torch")
startImport()
from PIL import Image, ImageFilter
import PIL
import mediapipe as mp
endImport("MediaPipe + PIL")
endTotal()
# Optional
saveCSV("importTime.csv")
Prints
Time to Import numpy: 0.08100032806396484
Time to Import torch: 0.9580004215240479
Time to Import MediaPipe + PIL: 2.0379998683929443
Total to Import Time: 3.077000141143799
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file importTime-1.0.3.2-py2.py3-none-any.whl
.
File metadata
- Download URL: importTime-1.0.3.2-py2.py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c0518e8a09d735a88019839e181246309b99a88ca0d654c40ca7634adc9d0cd |
|
MD5 | f0061e3055ee7435c16dd4e6805fd809 |
|
BLAKE2b-256 | e364b0758dcb2d6a7139e89ad7fa4026b4000ee5bf12d803d8cf3bbddb4543cb |