The following will measure page load time. Handy on MySQL functions, loops, APIs etc.
Place the following at the top of your page (or where you want to measure from).
Place the following at the bottom of your page (or where you want to measure to).
It makes sense to write them into functions so you can reuse them.