Bash 수행시간 측정

Jmnote (토론 | 기여)님의 2021년 4월 11일 (일) 03:19 판 (→‎실습)

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 }}