我用c实现不到一秒,python本身慢还是我实现的太蠢?求优化!
import math,time
testM = []
orgx = []
for i in range(8192):
orgx.append(1000*(math.sin(i/1000)))
time1 = time.localtime()
for i in range(200):
testM.append([])
for j in range(8192*4):
testM[i].append(orgx[j%8192])
print(time.localtime().tm_sec-time1.tm_sec)