It seems there is no standard for the metadata in mp3 and several different methods are in use. Some of them are at the end of the file and others at the beginning, so it's not straightforward.
Most of the tags give the name but not all of them give the length, and since mp3 is compressed in a non-linear way, there's no way to determine the length except by playing it.

I never went that far into the insides of mp3 coding. but since any file player software indicates the duration of an mp3 when you add it to the playlist, that information must be easy to get from somewhere.

Joao