์ƒˆ์†Œ์‹

๐Ÿ ํŒŒ์ด์ฌ (Python)

ํŒŒ์ด์ฌ ๋™์ž‘ ์‹คํ–‰ ์‹œ๊ฐ„ (์—ฐ์‚ฐ์‹œ๊ฐ„) ํ™•์ธ

  • -
import time
start=time.time()   #์‹œ์ž‘ ์‹œ๊ฐ„์„ start์— ์ €์žฅ




# ์ธก์ •ํ•  ์ฝ”๋“œ๋‚ด์šฉ (์ž„์˜๋กœ for๋ฌธ์œผ๋กœ ์ž‘์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค.)
    
    

print(time.time() - start)   # ์ข…๋ฃŒ์‹œ๊ฐ„(time.time()) - ์ฒ˜์Œ ์‹œ์ž‘์‹œ๊ฐ„(start) = ์‹คํ–‰์‹œ๊ฐ„

time ๋ชจ๋“ˆ์„ ์‚ฌ์šฉํ•˜์—ฌ, ํ”„๋กœ๊ทธ๋žจ ์‹œ์ž‘์‹œ๊ฐ„๊ณผ ์ข…๋ฃŒ์‹œ๊ฐ„์„ ์ธก์ •ํ•˜์—ฌ ํ™•์ธ ๊ฐ€๋Šฅํ•˜๋‹ค.

 

Contents

ํฌ์ŠคํŒ… ์ฃผ์†Œ๋ฅผ ๋ณต์‚ฌํ–ˆ์Šต๋‹ˆ๋‹ค

์ด ๊ธ€์ด ๋„์›€์ด ๋˜์—ˆ๋‹ค๋ฉด ๊ณต๊ฐ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.