Question: what is difference between before and earlier?
Answer: Before is capable of referring to time and place (Two soldiers stood before the door.) Earlier is exclusively a comparative adverb/adjective and does not require an object. It has the meaning of previous[ly].