Rotate GameObject using Coroutine

I want to continuously rotate my game object using coroutine. I have tried with my knowledge but didn’t get success in that.

    IEnumerator ContinuousRotation(){
		while(true){
			transform.Rotate(Vector3.forward * 10f);
			yield return new WaitForSeconds(0.01f);
		}
	}

Above code I have used but it didn’t rotate object. So please someone give suggestions to solve my problem.

To make something rotate you must write it inside Update. I think inside your couroutine mus be some kind of trigger to activate and then deactivate:

bool canRotate = false;

void Update() {
   if (canRotate) {
       transform.Rotate(Vector3.forward * 10f);   
   }

}

IEnumerator ContinousRotation() {
   canRotate = true;
   yield return new WaitForSeconds(0.01f);
   canRotate = false;
}

Following code work perfectly for me.

IEnumerator ContinuousRotation ()
    	{
    		while(true){
    			transform.Rotate(Vector3.forward,10);
    			yield return new WaitForSeconds (0.01f);
    		}
    	}

One thing I forgot to remove, I have to remove animator component from my gameobject.
Also it is not necessary to write rotation code in update method only.

Here I replied to help other members.
I got help from following link SPINNING CUBE