A number of ways but let's e.g. say that you kept the while loop then just get the time outside the loop and wire it into the loop..then after n iterations get the time within the loop and subtract the initial time.
Or skip the loop and use e.g. one-frame sequences to ensure (through data flow/data dependancies) that you get the time just prior to running the aquisition and then again just after...and find the difference. In this case you might want to use the milliseconds timer.
All the get time functions can be found on the time and dialog palette (subpalette of the functions palette).