Last active
December 5, 2016 10:04
-
-
Save Sinitca-Aleksandr/7ace7aa9ca765f8bda42552c0c22fe25 to your computer and use it in GitHub Desktop.
Рассмотрим на примере замера времени поэлементного умножения двух достаточно больших массивов. http://san-tit.blogspot.ru/2016/12/python.html
This file contains 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
import time | |
import numpy as np | |
#Генерация случайных массивов по 1000000 элементов | |
A = np.random.sample((1000, 1000)) | |
B = np.random.sample((1000, 1000)) | |
#Отсечка времени начала | |
start = time.time() | |
C = A*B | |
#Отсечка времени окончания | |
stop = time.time() | |
#Вычисление времени выполнения | |
sec = stop - start | |
#Вывод времени выполнения | |
print(sec) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment