1 Star 0 Fork 3

flyingakain/MultNodeVirtualLive

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
single_test.py 501 Bytes
一键复制 编辑 原始数据 按行查看 历史
Xingyan Chen 提交于 2023-03-02 16:59 . multi node version 0.0.4
import ray
import time
import numpy as np
import random
import string
from tqdm import tqdm
def search(array, n):
res = -1
for i in range(len(array)):
if array[i] == n:
res = i
break
if __name__ == '__main__':
array = np.random.randint(0, 1000, size=100)
array = list(array)
tic = time.time()
results = [search(array, random.randint(0, 1000)) for x in range(100000)]
duration = (time.time() - tic)
print("duration = "+ str(duration))
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/flyingakain/MultNodeVirtualLive.git
git@gitee.com:flyingakain/MultNodeVirtualLive.git
flyingakain
MultNodeVirtualLive
MultNodeVirtualLive
master

搜索帮助