Você pode usar date
util:
#!/bin/bash
start_measuring_time() {
read s1 s2 < <(date +'%s %N')
}
stop_measuring_time() {
read e1 e2 < <(date +'%s %N')
}
show_elapsed_time() {
echo "$((e1-s1)) seconds, $((e2-s2)) nanoseconds"
}
start_measuring_time
sleep 2
stop_measuring_time
show_elapsed_time