Ooooooooh I had trouble with this one too. I had to delve into the assembly line to make sure it was right, too.
gettime()
This will get the number of "ticks" essentially, since the program started running. Here's my timer code:
u64 start, diff; //u64 is defined as: "unsigned long long"
start = gettime();
// Stuff I want to time
// ...
diff = gettime() - start;
printf("\n\tTime:%lld", diff);
"ticks_to_millisecs()" will convert it to milliseconds.
Big props to ekeeke for helping me when I needed it here:
http://forum.wiibrew.org/read.php?11,42214,42479#msg-42479