A method for measuring strokes of CPR and a system using the method are disclosed. The system includes at least one permanent magnet and stroke detecting device which has a magnetic sensor, an accelerometer, a CPR detector, a controller, a power unit, and a housing. The system can measure strokes of CPR without a detector making patients uncomfortable. Meanwhile, the system is tiny and can be used to cooperate with AED.