Forum Documentation Showcase Pricing Learn more

My app runs in debug mode but stops when I don't run debugging

I’m building an Uber like app and I’m trying to calculate the fare by saving LOCATION A and TIME A when the driver picks up the passenger.

Every 30 seconds I save LOCATION B and TIME B, now I use LOCATION A - B to get the distance and TIME A - B to get the second spent in the time.

I use these to calculate the final fare.
I calculate these every 30 seconds because the passenger might will end the ride at the pickup location (roundtrip) so I need an accurate distance of the actual travel distance.

The problem I’m having is that the calculation doesn’t run every 30 seconds, only if I turn on debug mode.
In debug slow mode everything looks fine but if I run It normally, nothing happens.

Attached a gif, on the top of the screen you can see the time and distance as only changes when debug mode is on.

I think I’m trying to calculate to much information.
If I save distances every 30 second but only calculate the time and fare price at the end of the trip then everything works fine.

Interesting. if you can find a pattern email us, but good you got something that works.

1 Like