Here is another way, but it is only PIC18 compatible. It's real handy though:
http://www.picbasic.co.uk/forum/cont...te-XYZ-command

It explains it pretty well, I used it to time some cordic code, and others, and it did a nice job.

Walter