A construction machine comprising: a lower traveling body ; an upper slewing body mounted on the lower traveling body so as to be able to slew; a slewing motor that is formed of a hydraulic motor, and drives the upper slewing body to slew the upper slewing body ; a hydraulic pump that discharges a hydraulic fluid for actuating the slewing motor ; a control valve that is operated to control supply and discharge of the hydraulic fluid to and from the slewing motor ; a slewing operation device to which an operation for the control valve is applied, the slewing operation device adapted to actuate the control valve in accordance with the operation; a slewing brake that operates to apply a brake force to the slewing motor to mechanically stop the upper slewing body and to keep the upper slewing body stopped, when a neutral return operation for stopping slewing of the upper slewing body is applied to the slewing operation device ; a slewing speed sensor that detects a slewing speed of the upper slewing body to output a slewing speed signal; a slewing operation detector that detects an operation applied to the slewing operation device to output a slewing operation signal; and a controller to which the slewing speed signal from the slewing speed sensor and slewing operation signal from the slewing operation detector are input, characterized in that the controller is adapted to perform (i) storing the slewing speed detected by the slewing speed sensor as a stored value of the slewing speed at set time intervals while a slewing operation for slewing the upper slewing body is applied to the slewing operation device , (ii) actuating the slewing brake based on the neutral return operation of the slewing operation device , and (iii) resetting the stored value of the slewing speed that is stored during actuation of the slewing brake , to zero. a lower traveling body ; an upper slewing body mounted on the lower traveling body so as to be able to slew; a slewing motor that is formed of a hydraulic motor, and drives the upper slewing body to slew the upper slewing body ; a hydraulic pump that discharges a hydraulic fluid for actuating the slewing motor ; a control valve that is operated to control supply and discharge of the hydraulic fluid to and from the slewing motor ; a slewing operation device to which an operation for the control valve is applied, the slewing operation device adapted to actuate the control valve in accordance with the operation; a slewing brake that operates to apply a brake force to the slewing motor to mechanically stop the upper slewing body and to keep the upper slewing body stopped, when a neutral return operation for stopping slewing of the upper slewing body is applied to the slewing operation device ; a slewing speed sensor that detects a slewing speed of the upper slewing body to output a slewing speed signal; a slewing operation detector that detects an operation applied to the slewing operation device to output a slewing operation signal; and a controller to which the slewing speed signal from the slewing speed sensor and slewing operation signal from the slewing operation detector are input, characterized in that the controller is adapted to perform (i) storing the slewing speed detected by the slewing speed sensor as a stored value of the slewing speed at set time intervals while a slewing operation for slewing the upper slewing body is applied to the slewing operation device , (ii) actuating the slewing brake based on the neutral return operation of the slewing operation device , and (iii) resetting the stored value of the slewing speed that is stored during actuation of the slewing brake , to zero. <EOS>