summaryrefslogtreecommitdiff
path: root/misc/calcProd.py
diff options
context:
space:
mode:
Diffstat (limited to 'misc/calcProd.py')
-rw-r--r--misc/calcProd.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/misc/calcProd.py b/misc/calcProd.py
new file mode 100644
index 0000000..50a4a81
--- /dev/null
+++ b/misc/calcProd.py
@@ -0,0 +1,13 @@
+import time
+
+def calcProd():
+ product = 1
+ for i in range(1, 100000):
+ product = product + 1
+ return product
+
+startTime = time.time()
+prod = calcProd()
+endTime = time.time()
+print('The result is %s digits long.' % (len(str(prod))))
+print('Took %s seconds to calculate.' % (endTime - startTime))