aboutsummaryrefslogtreecommitdiff
path: root/sem4/hpp/m10/opg1.py
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2020-05-16 16:52:12 +0200
committerJulian T <julian@jtle.dk>2020-05-16 16:52:12 +0200
commit284afc630b3d0dd6c0079c6d3e83a73d6d1193e0 (patch)
tree3197f3d38587e53b1e4413813bc41e863ef81413 /sem4/hpp/m10/opg1.py
parent56f60d3409c035e12b1d7e21c14ff4f8ab43ecf9 (diff)
Added hpp assignments
Diffstat (limited to 'sem4/hpp/m10/opg1.py')
-rw-r--r--sem4/hpp/m10/opg1.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/sem4/hpp/m10/opg1.py b/sem4/hpp/m10/opg1.py
new file mode 100644
index 0000000..b8de12a
--- /dev/null
+++ b/sem4/hpp/m10/opg1.py
@@ -0,0 +1,17 @@
+#!/usr/bin/env python3
+# Measure the performance of your Python matrix multiplication
+import numpy as np
+import time
+
+size=1000
+
+a = np.random.random((size, size))
+b = np.random.random((size, size))
+
+start = time.time()
+result = a @ b
+end = time.time()
+
+
+print(result)
+print(f"Took { end - start } seconds")