Idk if you can calculate on the spot, but you can drive and detect when the player starts braking and start a timer and stop it when they stop…