How long can I drive on a bad camshaft sensor?

I am a hundred percent sure that it’s the camshaft sensor the ignition time of the car takes longer when I try to turn it on and i had a free check engine light service check and it showed that the problem was the knock sensor and the camshaft sensor I only replaced the knock sensor but the ignition time still had trouble??