With the aging of population, the number of total hip replacement (THR) surgeries increases year by year. To improve the success rate of THR operation, the measurement of acetabular prosthesis angles should be pr eci se dur i ng the sur g er y. We des ign an ine r ti al measurement unit based real-time measurement system, which measures the initial attitude of the pelvis coordinate, and traces the real-time attitude of the pelvis coordinate and prosthesis axis. By collecting real-time data of different pelvic and prosthesis attitudes in quaternion representation through accelerometers and gyroscopes, the relative position between pelvis and prosthesis is calculated in real time. An optimized algorithm is proposed to obtain prosthesis implant angles accurately from the data. The experimental results show that the measured implant angles agree with that calculated by radiographic value, the root mean square errors (RMSE) are less than 3.52 degrees, which is within the safe range of THR requirement. Furthermore, no matter how the implant angles change, the measured values agree with reference values, the RMSE is less than 3.27 degrees. The experimental results show that our system can trace the real-time dislocation of the prosthesis during the THR surgeries. Index Terms-Total hip replacement (THR), inertial measurement unit (IMU), real-time measurement, acetabular prosthesis implant angles.