def get_stream_duration(stream):
epoch = lal.LIGOTimeGPS(stream.epoch.gpsSeconds,<EOL>stream.epoch.gpsNanoSeconds)<EOL>nfile = stream.cache.length<EOL>duration = <NUM_LIT:0><EOL>for dummy_i in range(nfile):<EOL><INDENT>for dummy_j in range(lalframe.FrFileQueryNFrame(stream.file)):<EOL><INDENT>duration += lalframe.FrFileQueryDt(stream.file, <NUM_LIT:0>)<EOL>lalframe.FrStreamNext(stream)<EOL><DEDENT><DEDENT>lalframe.FrStreamSeek(stream, epoch)<EOL>return duration<EOL>
Find the duration of time stored in a frame stream

    Parameters
    ----------
    stream : `lal.FrStream`
        stream of data to search

    Returns
    -------
    duration : `float`
        the duration (seconds) of the data for this channel