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?