summaryrefslogtreecommitdiffstats
path: root/solutions/py/d06.py
diff options
context:
space:
mode:
authorGustav Sörnäs <gusso230@student.liu.se>2019-12-08 22:10:51 +0100
committerGustav Sörnäs <gusso230@student.liu.se>2019-12-08 22:10:51 +0100
commit2e74b1b0caeb0e0490c563635af6bef28a990ec6 (patch)
treeebd0fd46184e66db70d2e95fc3cf6e47e2fafe15 /solutions/py/d06.py
parentd8f929604f18cacc40eec80f3bbd4386757a4902 (diff)
downloadaoc-2e74b1b0caeb0e0490c563635af6bef28a990ec6.tar.gz
Add cProfiler
Diffstat (limited to 'solutions/py/d06.py')
-rw-r--r--solutions/py/d06.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/solutions/py/d06.py b/solutions/py/d06.py
index b6b9ef7..0b54362 100644
--- a/solutions/py/d06.py
+++ b/solutions/py/d06.py
@@ -76,3 +76,12 @@ def pt2(input):
tar_dist += 1
if src_parent == tar_parent:
return (src_parent.name, src_dist, tar_dist, src_dist + tar_dist)
+
+if __name__ == "__main__":
+ import cProfile
+
+ input = open("../input/06", "r").readlines()
+ cProfile.run("pt1(input)")
+ cProfile.run("pt2(input)")
+ print(pt1(input))
+ print(pt2(input))