Skip to content

Commit

Permalink
Scope time import (#14)
Browse files Browse the repository at this point in the history
Signed-off-by: Glenn Jocher <[email protected]>
Co-authored-by: UltralyticsAssistant <[email protected]>
  • Loading branch information
glenn-jocher and UltralyticsAssistant authored Jan 16, 2025
1 parent 6d88bb8 commit a258e9f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions autoimport/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import builtins
import importlib
import sys
import time
import types


Expand Down Expand Up @@ -89,7 +88,9 @@ def __exit__(self, *args):


if __name__ == "__main__":
# Context manager tests -----------------------------
import time

# Context manager
with lazy():
t0 = time.perf_counter()
import numpy as np
Expand Down Expand Up @@ -118,7 +119,7 @@ def __exit__(self, *args):
print(linalg.det(A))
print(time.perf_counter() - t5)

# Direct LazyLoader() tests ------------------------
# Direct usage of LayzLoader class
t6 = time.perf_counter()
seaborn_lazy = LazyLoader("seaborn")
print(time.perf_counter() - t6)
Expand Down

0 comments on commit a258e9f

Please sign in to comment.