I'm finding SDBSongList.Item() taks about 15ms on a 150-track list but this soars to ~200ms with around 5000 tracks. (Source: timestamps here http://pastebin.com/nLg85xA4 )
Code: Select all
dur = dur + SDBplaylistobject.Tracks.Item(i).SongLength / 1000 '' ms per s
So looping through all tracks is far too slow.
I guess MM itself must have a better way since it shows the total duration in the status bar within moments of that being changed by addition of a new track. But it seems not exposed to scripting.
FWIW, 1708 is the same.