@evinda You know exactly how many times the loop would be called. You populate the new list by removing an element from the heap. The new list should have $n$ elements. Therefore, you should be looping $n$ times and removing an element from the heap $n$ times.
Sorry for the delayed response, I've been gone for a while.