ahead of time vs beforehand

ahead of time

prep
  • prior to the expected time; early. 

beforehand

adv
  • At an earlier or preceding time. 

How often have the words ahead of time and beforehand occurred in a corpus of books? (source: Google Ngram Viewer )