@staticmethod
def _queue_duration(queue):
    """Get time span in milliseconds of files in a queue."""
    try:
        oldkey, _ = queue[0]
        newkey, _ = queue[-1]
    except IndexError:
        return 0
    return newkey - oldkey
