diff --git a/common/speedometer.cpp b/common/speedometer.cpp index c68b20a..a24d685 100644 --- a/common/speedometer.cpp +++ b/common/speedometer.cpp @@ -110,7 +110,7 @@ void Speedometer::computeSpeed() { // TODO : done //Distance run with one pedal turn = tray size / rear gear size * circumference of the wheel constexpr float ms_in_hour = static_cast(3600 * 1000); - float pedal_rotation_per_hour = ms_in_hour / static_cast(_pedalRotationTime.count()); + float pedal_rotation_per_hour = ms_in_hour / std::chrono::duration_cast(_pedalRotationTime).count(); float gear_ratio = static_cast(kTraySize) / static_cast(this->_gearSize); float wheel_dist_km = static_cast(this->kWheelCircumference) / 1000.0; this->_currentSpeed = gear_ratio * wheel_dist_km * pedal_rotation_per_hour; @@ -141,4 +141,4 @@ void Speedometer::computeDistance() { _lastTime = _timer.elapsed_time(); } -} // namespace bike_computer \ No newline at end of file +} // namespace bike_computer