Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while True:
- start = time.time()
- print(buffering)
- if buffering:
- with open(file=file_path, buffering=buffering, encoding=encoding) as file:
- file.read()
- else:
- with open(file=file_path, encoding=encoding) as file:
- file.read()
- buffering = 1
- end = time.time()
- result_old = result_new
- result_new = end - start
- print(result_old)
- print(result_new)
- if i:
- if result_new > result_old:
- print('Минимальное время выполнения: {0:.20f} секунд.'.format(result_old))
- print('Buffer size: ' + str(buffering))
- break
- else:
- if buffering == 1:
- buffering = 2
- else:
- buffering = buffering ** 2
- i += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement