Keeping things in memory can be done in numerous ways in LabVIEW; wires, controls and indicators, globals, functional globals, locals, ques etc etc... The wires keep values in memory so if you have read the time and you need it later to subtract it from a new one just wire the old time value to the place in the code where you need it. Now you have to make sure you get the time prior to the start of the operation you want to time, and that the end time is read afterwards...to do that you can control the execution order using data dependancies. In some cases that's easily done just with wires, in other cases it can be useful to use a sequence structure or two...(people new to LV has a tendency to use sequences for everything. The best way to control execution in
LV is by data flow, a single frame sequence can be useful though).
If you want to calculate the time used by n iterations of a loop...use a shift register. Right-click on the border of the loop and select to create a shift register. The shift register is a way to pass data from one iteration to another; when you want to get the start time, read it and write the value to the right hand shift register terminal...Now you can read that value on the next iteration(s) from the left terminal. Put a case around the get time part and only run it when you want a new start time, in the other cases just wire the value from the left to the right shift register terminal.
In the attached example the average time per iteration is calculated every five iterations for a loop containing just a wait function (you would replace that with whatever code you have...).