Last active
March 11, 2020 13:00
-
-
Save maphew/75fe87663313c6eba3c5d747dff7f2cc to your computer and use it in GitHub Desktop.
What is your "import arcpy" overhead?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'''Measure and report the time it takes to simply `import arcpy` | |
Part of https://community.esri.com/message/914048-re-what-is-your-import-arcpy-overhead? | |
''' | |
from timeit import default_timer as timer | |
start = timer() | |
from datetime import datetime, timedelta | |
from uuid import uuid4 | |
eventid = datetime.now().strftime('%Y%m-%d%H-%M%S-') + str(uuid4()) | |
start_arc = timer() | |
import arcpy | |
done_arc = timer() - start_arc | |
import os | |
machine = os.environ['COMPUTERNAME'] | |
d = arcpy.GetInstallInfo() | |
print("{:12} {:10} {:10} {:10} {:10} {:>10} {:>56}".format("Machine", | |
"Product", | |
"Version", | |
"Build", | |
"License", | |
"LoadArcpy", | |
"EventID")) | |
print("{:12} {:10} {:10} {:10} {:10} {:>10} {:>56}".format(machine, | |
d['ProductName'], | |
d['Version'], | |
d['BuildNumber'], | |
d['LicenseLevel'], | |
round(done_arc,3), | |
eventid)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Machine Product Version Build License LoadArcpy EventID | |
ENV-Y225411 ArcGISPro 2.5 22081 Advanced 8.005 202003-0616-3707-a5291176-75df-44dc-bc20-5bc845fa6e21 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment