\textit{Objective}. Beams of stable ions have been a well-established tool for radiotherapy for many decades. In the case of ion beam therapy with stable $^{12}$C ions, the positron emitters $^{10,11}$C are produced via projectile and target fragmentation, and their decays enable visualization of the beam via positron emission tomography (PET). However, the PET activity peak matches the Bragg peak only roughly and PET counting statistics is low. These issues can be mitigated by using a short-lived positron emitter as a therapeutic beam. \textit{Approach.} An experiment studying the precision of the measurement of ranges of positron emitting carbon isotopes by means of PET has been performed at the FRS fragment-separator facility of GSI Helmholtzzentrum f"ur Schwerionenforschung GmbH, Germany. The PET scanner used in the experiment is a dual-panel version of a Siemens Biograph mCT PET scanner. \textit{Main results.} High quality in-beam PET images and activity distributions have been measured from the in-flight produced positron emitting isotopes $^{11}$C and $^{10}$C implanted into homogeneous PMMA phantoms. Taking advantage of the high statistics obtained in this experiment, we investigated the time evolution of the uncertainty of the range determined by means of PET during the course of an irradiation, and show that the uncertainty improves with the inverse square root of the number of PET counts. The uncertainty is thus fully determined by the PET counting statistics. During the delivery of 1.6$\times$10$^7$ ions in 4 spills for a total duration of 19.2~s, the PET activity range uncertainty for $^{10}$C, $^{11}$C and $^{12}$C is 0.04, 0.7 and 1.3~mm, respectively. The gain in precision related to the PET counting statistics is thus much larger when going from $^{11}$C to $^{10}$C than when going from $^{12}$C to $^{11}$C. The much better precision for $^{10}$C is due to its much shorter half-life, which, contrary to the case of $^{11}$C, also enables to include the in-spill data in the image formation. \textit{Significance}. Our results can be used to estimate the contribution from PET counting statistics to the precision of range determination in a particular carbon therapy situation, taking into account the irradiation scenario, the required dose and the PET scanner characteristics.