you can use the time command on Unix based systems or subsystems:
time echo "Hello world"
to time how long it takes to run
echo "Hello world"
It has millisecond precision, and shows how much time was spent in the program, waiting on the system and the total execution time