How can I use NSTimer with this simple while loop?
===

I have a -(void) method being executed and at one point it gets to a while loop that does something.

The moment I enter the while loop I want to set off a timer and keep running round the while loop until the timer reaches e.g. 1.4 sec at which point I will exit the while loop and move on to the next bit of code of my -(void) method.

I went throughout the documentation regarding the NSTimer class but I couldn't make sense of how exactly I am to use this object in my case :

e.g.


    -(void) play
    {
        ......
        ...
        
        startTimer;
        
        while(timer!=1.4)
        {
            X++;
        }
        
        stopTimerAndSetTimerToZero;
        
        .....
        useValueofX;
        ....
        ...
    }

Any help?