a while / awhile
The noun phrase a while versus the adverb awhile.
Use a while after a preposition (for a while, in a while, after a while). Use awhile only as an adverb meaning “for a short time,” and only when no preposition is present. When in doubt, write a while.
Examples
Use Let the bread cool awhile before you slice it.
Use Let the bread cool for a while before you slice it.
Avoid Let the bread cool for awhile before you slice it. (Change awhile to a while.)
Use It has been a while since we spoke.
After the or this, write while: all the while, all this while.