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
CPU
0.0s
MEM
3M
2.0s
Copy
time sleep 2
real 0m2.006s user 0m0.003s sys 0m0.000s
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
로그인하시면 댓글을 쓸 수 있습니다.
- 분류 댓글:
- Bash (3)
로또번호 생성 ―Pinkcrimson
리눅스 날짜 기준으로 파일 삭제하기 ― 백승현리눅스 날짜 기준으로 파일 삭제하기 ― Jmnote