1 개요[ | ]
- Bash 수행시간 측정
- 리눅스 수행시간 측정
Bash
Copy
time 수행할명령어
Bash
Copy
time ( 수행할명령어 ) 2>/tmp/temp.txt
awk -F'[ ms]+' '/^real/ {print 1000*$2"ms"}' /tmp/temp.txt
rm -f /tmp/temp.txt
2 실습[ | ]
Bash
Copy
time sleep 2
Loading
Bash
Copy
time ( sleep 2 ) 2>/tmp/temp.txt
awk -F'[ ms]+' '/^real/ {print 1000*$2"ms"}' /tmp/temp.txt
Loading
Console
Copy
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 같이 보기[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.