How the time of execution could be checked?

I need to see how much time my script uses to execute different part of processing.
Is there anything to get it?

I see the shell biultin variable $SECONDS, but I need much more precise statistic, in mili or micro seconds.

Is there anything available for that?

I use bash shell.

Thank you.

Look at the "time" command

I've checked time, timex, times even before posting the question and reviewed 'time' now.
As I understand I need in every comand in my screept add the time and get what: time of executing that one command?
Or redirect the time's output somewhere, take the result and calculate a time from beginning of the script?
Very uncomfortable!
That not what I am looking for.

I would assume to be able to put a line anywhere in script something like that:

>...
> echo "Processing time from beginning of the script="$(some_time_getting_util)

>...

You simply pre-pend the "time" command to your script. When your script ends, the execution time, cpu time, etc will be printed to STDOUT...

> time yourscriptname

your script's output....

real 0m0.005s
user 0m0.010s
sys 0m0.000s
>

The last 3 lines are the output of time command... Isn't that what you asked for?

Something like that ?

start_time=$(date "+%s.*N")
#...
#do something here
#...
sleep 5
echo "Processing time from beginning of the script = $(echo "$(date "+%s.%N")- $start" | bc) seconds"