What is the difference between 总是 and 一直? I've always (no pun intended) wondered what the difference is between the two words. I thought they both meant always, but I've never quite grasped in what context they should be used.

Could anyone shed any light on this?
They are synonyms.

总是 places an emphasis on frequency.


  他上课总是迟到 = He kept being late for class all the time.


一直 places an emphasis on consistency.


  他一直是个好孩子 = He has been a good kid through the years.