My 2002 X5 with 4.4i engine at 150,000 miles. . . .suddenly took a long time to start in the morning. Initially, it would crank for 5 seconds, then I would turn the key off, wait a few seconds and try again. Usually on the second or third try, it would suddenly catch. Sometimes, it seemed as though the ignition was too advanced momentarily while starting.
Once the car was warm, restarts were normal. I began to suspect the fuel pump or fuel related problems. I placed a fuel pressure guage on the injector rail one cold morning and noted that the start up fuel pressure was very low. I then ran power directly to fuel pump under the seat and noted normal fuel pressure.
Hmmmm, something was telling the computer not to pressurize the injector rail during start up.
OBD2 codes showed random misfires on almost all cylinders. Lean condition?!?
Then. . . . .the next morning, I went to start the car, and it just cranked and cranked with no start whatsoever. I took another OBD2 check. . .Viola! PO335 and PO370 popped up for the first time.
Crank position sensor installed. New spark plugs (originals were still in the car!!!!). When I started the car, it started instantly, and had so much bottom end power, that it took some getting used to taking off without jerking the entire vehicle.
The crankshaft position sensor was very easy to access. It is located under the vehicle plugged into the transmission bell housing. You get at it from the passenger side. It is held in with a allen key screw. I did not have to remove any bottom covers. But it probably is easier to remove sensor if you do. I got the part for 100 bucks shipped from rock auto.
Moral of the story. . . a failing crankshaft position sensor may or may not throw a code. If sensor wiring is okay. . .consider it strongly in a no start, or long crank situation. It will cause a: 1) no spark condition, 2) and will not allow the fuel pump to pump up the injector rail very much at start up.
Now, I am doing an entire maintenance check on the vehicle. I ve had it since 90k and drove it 140 miles round trip five days a week. The only issues Ive had with it was a dead alternator after giving someone a boost.

. The battery was also replaced. I also replaced some hoses in the back of the engine that were sucking air. Knock on wood for another 60k trouble free miles.