In discontinuous gas exchange, however, the insect takes in oxygen while it is active and small amounts of carbon dioxide are released when the insect is at rest.