The passato prossimo is the more common of the two and indicates a past, completed action. e.g. ieri, ho dormito per 8 ore. l'imperfetto, on the other hand is for continuous or repeated actions. e.g when i was little... I went to the park every saturday- quand ero piccolo andavo al parco ogni sabato. another example in english is 'I was doing/eating/walking' as it is a continuous action (present participle), which would translate as 'facevo, mangiavo, camminavo'.a full sentence would be :mentre ascoltavo la mia musica preferita, ho finito i miei compiti.whilst i was listening to my favourite music, i finished my homework.