How do you spell "for a while"?
Adverb "briefly" is written in two versions: the particle of negation "not" is merged with the adverb "for a long time" and separately, since "for a short while" is a word-exception to the rules and has a double meaning.
Example: a child needs a stroller for a short while. In this example, the adverb "briefly" is written together, since it is claimed that the child needs the stroller for a short time. The same example, but with a separate writing of the particle "not": the child needs a stroller not for long. In this case, "not for long" implies "not for a long time", so the negation particle "not" is written separately from the adverb.
How do you spell for a short while, if there is an a-word in the sentence with this phrase? We write separately: not for long. Example: came to us not for long, but only for five minutes.
To the same adverbs-exceptions, which can be written in two versions, are: shortly, inappropriately, not much, not far off.
Let's sum up. We write "briefly" together, if there is no opposition with the union "a" and if the word has a semantic meaning "for a short time". We write "not for long" separately, if there is an opposition with the union "a" and if the word has a semantic meaning: "not for a long time."
Clicking on the link: www.textfighter.org, you can get acquainted with the rules for writing the particle "not" with adverbs, including examples of writing and using the word "not for long".