One time camera rotation, how do I check for when it is completed rotating?

I implemented a one time camera rotation for a game menu using this code. (iPhone)

void Update() 
{               
    Vector3 relativePos = lookTarget.position - transform.position;
    Quaternion newRotation = Quaternion.LookRotation(relativePos);
    transform.rotation = Quaternion.Lerp(oldRotation, newRotation, Time.time * .01f);
    oldRotation = transform.rotation;
}

My question is how do I check to see if the camera is done rotating and looking at my target? My thinking is that I don't need it to rotate anymore once it is looking at my target object and didn't want to keep making the calculations, I need all I can get. What would I check for to see if it is indeed looking at the target object? Is it better to throw it into a while loop or a coroutine?

First of all, you almost certainly don't want to use Time.time (directly or indirectly) as your interpolation parameter. As your code is now, the turning behavior will change the longer the game's been running, which I doubt is what you want. Also, after 100 seconds, the object won't turn gradually at all - it'll just snap directly to the new orientation.

If you want to use Slerp() or Lerp() for this, try instead using a constant value somewhere in the range (0, 1) for the interpolation parameter.

As for determining when the object is 'looking at' its target, one solution would be to check the absolute value of the dot product of the quaternions representing the current orientation and 'newRotation' and see if it's above some threshold (e.g. .99). There are the other ways to solve the problem, but that's probably the most general solution.