Some famous songs are painstakingly written over weeks, months, or even YEARS. But others are written in almost no time at all.  And sometimes, like in the case of "My Sharona", it definitely shows...but hey, a hit is a hit, right? has a list of "20 Monster Hit Songs That Were Written In Just Minutes."  Not all of them are listed with the how long they took to write, but major components of all of them were done in less than a day.  Here's a few highlights:

"Sweet Child O' Mine", Guns N' Roses.  Slash says the riff came together in five minutes, and the rest of the song followed.

"Yesterday", The Beatles.  Paul McCartney says he woke up one day with the song in his head, and immediately started working it out on the piano.  He did spend a good amount of time writing the lyrics, though.

"Rock 'N' Roll", Led Zeppelin.  It was written in 15 minutes, after drummer John Bonham launched into the intro for Little Richard's "Keep a Knockin'".

Here's "Keep a Knockin'". Listen to the opening drum riff:

And here's "Rock 'N' Roll" by Led Zeppelin:

"What'd I Say", Ray Charles.  He came up with the groove while screwing around at the end of a late night set.

"(You Gotta) Fight for Your Right (to Party)", The Beastie Boys.  They've said they wrote the lyrics on a napkin in FIVE minutes.

"Skyfall", Adele.  She wrote the lyrics in 10 minutes . . . and it won her a Grammy, a Golden Globe and an Oscar.

"My Sharona", The Knack.  Guitarist Berton Averre had been kicking the riff around for years, but singer Doug Fieger insisted that the rest was written in under 15 minutes.

"Under Pressure", Queen & David Bowie.  They supposedly wrote it in one night . . . although some say the classic bass line was added later.

"(I Can't Get No) Satisfaction", The Rolling Stones.  Keith Richards laid down the hook on a bedside tape recorder just before falling asleep.