Shell script which returns elapsed time, memory usage and CPU usage of executed script

Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I need to write a bash script which will be able to return elapsed time, RAM usage and CPU usage of executed script.
my script:
#!/bin/bash
STARTTIME=$(date +%s%N)
#here is script which needs to be executed
ENDTIME=$(date +%s%N)
echo Elapsed time: $(($(($ENDTIME - $STARTTIME))/1000000))ms
Elapsed time works, but how to do the rest?
linux bash scripting
New contributor
Marek Mularczyk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
0
down vote
favorite
I need to write a bash script which will be able to return elapsed time, RAM usage and CPU usage of executed script.
my script:
#!/bin/bash
STARTTIME=$(date +%s%N)
#here is script which needs to be executed
ENDTIME=$(date +%s%N)
echo Elapsed time: $(($(($ENDTIME - $STARTTIME))/1000000))ms
Elapsed time works, but how to do the rest?
linux bash scripting
New contributor
Marek Mularczyk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I need to write a bash script which will be able to return elapsed time, RAM usage and CPU usage of executed script.
my script:
#!/bin/bash
STARTTIME=$(date +%s%N)
#here is script which needs to be executed
ENDTIME=$(date +%s%N)
echo Elapsed time: $(($(($ENDTIME - $STARTTIME))/1000000))ms
Elapsed time works, but how to do the rest?
linux bash scripting
New contributor
Marek Mularczyk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I need to write a bash script which will be able to return elapsed time, RAM usage and CPU usage of executed script.
my script:
#!/bin/bash
STARTTIME=$(date +%s%N)
#here is script which needs to be executed
ENDTIME=$(date +%s%N)
echo Elapsed time: $(($(($ENDTIME - $STARTTIME))/1000000))ms
Elapsed time works, but how to do the rest?
linux bash scripting
linux bash scripting
New contributor
Marek Mularczyk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Marek Mularczyk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Marek Mularczyk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 8 mins ago
Marek Mularczyk
11
11
New contributor
Marek Mularczyk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Marek Mularczyk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Marek Mularczyk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Marek Mularczyk is a new contributor. Be nice, and check out our Code of Conduct.
Â
draft saved
draft discarded
Marek Mularczyk is a new contributor. Be nice, and check out our Code of Conduct.
Marek Mularczyk is a new contributor. Be nice, and check out our Code of Conduct.
Marek Mularczyk is a new contributor. Be nice, and check out our Code of Conduct.
Â
draft saved
draft discarded
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f476581%2fshell-script-which-returns-elapsed-time-memory-usage-and-cpu-usage-of-executed%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password