A device for measuring a component in exhaled breath comprising an inlet (32) for receiving exhaled breath, a buffer chamber (31). A first fluid conduit (34a) is in fluid connection with the inlet and adapted to lead a first portion (Γ) of the exhaled breath to the buffer chamber. The buffer chamber comprises an outlet (37) for discarding a first part of exhaled breath received from the first fluid conduit and the buffer chamber is configured to buffer a second part of exhaled breath received from the first fluid conduit. The device comprises a second fluid conduit (34b) in fluid connection with the inlet and adapted to lead a second portion (I″) of the exhaled breath to be discarded, and a sensor (63) for measuring a component in the exhaled breath buffered in the buffer chamber.