A system for measuring a length variation between body portions in computer-assisted surgery between a preoperative condition and an intra- or post-operative condition comprising: a rangefinder apparatus comprising a rangefinder configured to measure its distance to at least one reference landmark on at least a first body portion of a patient from a known position relative to a second body portion by emitting light on the at least one reference landmark and optically detecting its distance from the light on the at least one reference landmark, a support including at least one joint allowing at least one rotational degree of freedom of movement of the rangefinder to point to the at least one reference landmark, and an inertial sensor unit connected to the rangefinder to produce orientation data for the rangefinder ; and a computer-assisted surgery processing unit having a tracking module for tracking the rangefinder in a virtual coordinate system using the orientation data, a coordinate system module for determining coordinates in the virtual coordinate system of the at least one reference landmark using at least one combination of the distance and the orientation data, the orientation data being instant to the distance in the at least one combination; and a length calculation module for measuring a preoperative length between the body portions using the coordinates of light emitted on the at least one reference landmark in a preoperative condition, and for measuring an intra- or post-operative length between the body portions using the coordinates of light emitted on the at least one reference landmark in an intra- or post-operative condition, wherein the length calculation module is configured to calculate and output the length variation between the body portions by using said preoperative length obtained from the preoperative condition and said intra- or post-operative length obtained from the intra-or post-operative condition. a rangefinder apparatus comprising a rangefinder configured to measure its distance to at least one reference landmark on at least a first body portion of a patient from a known position relative to a second body portion by emitting light on the at least one reference landmark and optically detecting its distance from the light on the at least one reference landmark, a support including at least one joint allowing at least one rotational degree of freedom of movement of the rangefinder to point to the at least one reference landmark, and an inertial sensor unit connected to the rangefinder to produce orientation data for the rangefinder ; and a computer-assisted surgery processing unit having a tracking module for tracking the rangefinder in a virtual coordinate system using the orientation data, a coordinate system module for determining coordinates in the virtual coordinate system of the at least one reference landmark using at least one combination of the distance and the orientation data, the orientation data being instant to the distance in the at least one combination; and a length calculation module for measuring a preoperative length between the body portions using the coordinates of light emitted on the at least one reference landmark in a preoperative condition, and for measuring an intra- or post-operative length between the body portions using the coordinates of light emitted on the at least one reference landmark in an intra- or post-operative condition, wherein the length calculation module is configured to calculate and output the length variation between the body portions by using said preoperative length obtained from the preoperative condition and said intra- or post-operative length obtained from the intra-or post-operative condition. <EOS>