import time
import random
arr = []
for _ in range(100000):
arr.append(random.randint(1,10000))
start_time = time.time() # ์ธก์ ์์
arr.sort()
end_time = time.time() # ์ธก์ ๋
print('time:',end_time - start_time)
์ถ๋ ฅ: time: 0.012936830520629883
๋จ์๋ ์ด
'๐ Language > [python]' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[ํ์ด์ฌ] ์ฝฐ์ธ(Quine) ํ๋ก๊ทธ๋จ (0) | 2023.07.20 |
---|---|
[ํ์ด์ฌ] dis๋ชจ๋๋ก ๋ฐ์ดํธ ์ฝ๋ ํ์ธ - dis (0) | 2022.08.08 |
[ํ์ด์ฌ] if __name__ == "__main__" (0) | 2022.08.03 |
[ํ์ด์ฌ] ์์ด๊ณผ ์กฐํฉ - permutations, combinations (0) | 2022.08.03 |
[ํ์ด์ฌ] sort (feat. lambda) (0) | 2022.08.02 |