If the crankshaft position sensor is acting up it will give you a P0335 code... if the car starts normally 3 times in a row it will clear the CEL... the CPS sensor still needs to be replaced!
It is just messing with you and WILL fail again.... at the most inconvenient times