Indeed the commands "tic" and "toc" are the simplest ones. However, if you want a more detailed report, analysing the time and the execution percentage for each line of your code, the best command is "profile". It creates a report in HTML format that can be opened automatically at your standard browser.
To access the browser automatically, Matlab will need some toolbox files, like:
Kouba, I have used both functions: tic/toc and cputime. If you also have the same code implemented in C/C++ and compare the execution time of both codes using the tic/toc functions, you will be able to see a big difference. This happens because of the difference in the details of implementation. The use of the tic/toc functions is more indicated when you are running only your MATLAB code. They work based on the processor clock and yield a more precise outcome.