@Svejk
In fact, respiration occurs *all the time* in a plant. The difference is that, under ideal conditions, the photosynthesis is supplying all the plant's internal needs with enough excess to pump the leftovers out into the atmosphere.
I have to emphasise "ideal conditions" because cellular processes run faster at higher temperatures. In summer, or in the tropics, the cell processes using up oxygen all-but outpace the photosynthesis.
Tropical hardwoods notoriously take longer than a human lifetime to get from planting to felling. Meanwhile, paper manufacturers use softwood trees which are grown closer to the arctic circle. Lower temperature, lower respiration rates and more rapid laying down of wood mass.
Whenever I hear "the rain forest is the lungs of the planet", I think of the above and hold my tongue. (It's too much explanation for casual conversation).