from timeit import timeit
import numpy as np
def FuncA():
a = np.arange(100000)
b = np.arange(100000)
c = a**2 + b**2
return c
print( "Start to execute FuncA" )
# timeit ( '函數名稱' , 'from __main__ import 函數名稱', number = 執行次數)
t = timeit( 'FuncA()','from __main__ import FuncA', number = 5000 )
print( "FuncA takes " + str(t) + " msec\r\n" )
input()
我將定期推出程式語言的新手教學影片