From 284afc630b3d0dd6c0079c6d3e83a73d6d1193e0 Mon Sep 17 00:00:00 2001 From: Julian T Date: Sat, 16 May 2020 16:52:12 +0200 Subject: Added hpp assignments --- sem4/hpp/m10/opg1.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 sem4/hpp/m10/opg1.py (limited to 'sem4/hpp/m10/opg1.py') 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") -- cgit v1.2.3