import glob
import time
import random


filelist = glob.glob('/mnt/lustre/chenyuntao1/datasets/imagenet/train/*/*')
random.shuffle(filelist)

begin = time.time()
for i, f in enumerate(filelist):
    if i == 10000:
        break
    with open(f, "rb") as fin:
        result = fin.read()
end = time.time()

print("%.1f images/s" % (10000 / (end - begin)))
[((6, 11, 6, 75), 'glob.glob', 'glob.glob', ({(6, 21, 6, 74): '"""/mnt/lustre/chenyuntao1/datasets/imagenet/train/*/*"""'}, {}), "('/mnt/lustre/chenyuntao1/datasets/imagenet/train/*/*')", False, 'import glob\n'), ((7, 0, 7, 24), 'random.shuffle', 'random.shuffle', ({(7, 15, 7, 23): 'filelist'}, {}), '(filelist)', False, 'import random\n'), ((9, 8, 9, 19), 'time.time', 'time.time', ({}, {}), '()', False, 'import time\n'), ((15, 6, 15, 17), 'time.time', 'time.time', ({}, {}), '()', False, 'import time\n')]