"Bash 수행시간 측정"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-source +syntaxhighlight))
 
(같은 사용자의 중간 판 3개는 보이지 않습니다)
2번째 줄: 2번째 줄:
;Bash 수행시간 측정
;Bash 수행시간 측정
;리눅스 수행시간 측정
;리눅스 수행시간 측정
<syntaxhighlight lang='bash'>
time 수행할명령어
</syntaxhighlight>
<syntaxhighlight lang='bash'>
<syntaxhighlight lang='bash'>
time ( 수행할명령어 ) 2>/tmp/temp.txt
time ( 수행할명령어 ) 2>/tmp/temp.txt
10번째 줄: 12번째 줄:


==실습==
==실습==
<syntaxhighlight lang='bash' run>
time sleep 2
</syntaxhighlight>
<syntaxhighlight lang='bash' run>
time ( sleep 2 ) 2>/tmp/temp.txt
awk -F'[ ms]+' '/^real/ {print 1000*$2"ms"}' /tmp/temp.txt
</syntaxhighlight>
<syntaxhighlight lang='console'>
<syntaxhighlight lang='console'>
jmnote@zetawiki:~$ time ( sleep 2 ) 2>/tmp/temp.txt
jmnote@zetawiki:~$ time ( sleep 2 ) 2>/tmp/temp.txt
24번째 줄: 33번째 줄:


[[분류: Bash]]
[[분류: Bash]]
[[분류: 수행시간 측정]]

2021년 11월 8일 (월) 23:39 기준 최신판

1 개요[ | ]

Bash 수행시간 측정
리눅스 수행시간 측정
time 수행할명령어
time ( 수행할명령어 ) 2>/tmp/temp.txt
awk -F'[ ms]+' '/^real/ {print 1000*$2"ms"}' /tmp/temp.txt
rm -f /tmp/temp.txt

2 실습[ | ]

time sleep 2
time ( sleep 2 ) 2>/tmp/temp.txt
awk -F'[ ms]+' '/^real/ {print 1000*$2"ms"}' /tmp/temp.txt
jmnote@zetawiki:~$ time ( sleep 2 ) 2>/tmp/temp.txt
jmnote@zetawiki:~$ awk -F'[ ms]+' '/^real/ {print 1000*$2"ms"}' /tmp/temp.txt
2001ms
jmnote@zetawiki:~$ rm -f /tmp/temp.txt
jmnote@zetawiki:~$

3 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}