Car loses power

My car will sometimes, while on the highway, “sigh” and then loose power, although the engine is still on. I have about 15 seconds to pull over. Sometimes, if I put it in neutral and rev the engine, it will come back. Sometimes, I have to turn off the ignition, and start it again. My mechanic can’t figure it out, and says that everything checks out OK. Any suggestions?