Add up total length of selected lines

I know you can use the measure length tool to quickly measure a line, curve, etc. But it there a command or macro that you can use to select any number of lines, curves, etc and have the total length added up and displayed?