Record time of samples

Hi all,

Does anyone know how to record the exact arrival time of a package or
the
end of some samples using USRP? I used the following code in GRC:

if name == ‘main’:
parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
(options, args) = parser.parse_args()
tb = flow_graph()
tb.Run(True)
a = strftime("%Y-%m-%d %H:%M:%S", gmtime())
print a

However, this only shows the end time when I stop the flow graph
manually.
Is there a way in gnuradio that can read the system time during the
running
of the program?

For example, the flow graph begins to run and receive --> after 1000
samples have been received, output system time --> the program continues
to
run…

In addition, how to stop a grc flow graph automatically?

Any response will be appreciated.

Thanks in advance.

Jamie

Does anyone know how to record the exact arrival time of a package or the
end of some samples using USRP? I used the following code in GRC:

In a related note, you can use stream tags to get a precise timestamp of
every sample in the stream:
http://gnuradio.org/cgit/gnuradio.git/tree/gr-uhd/include/gr_uhd_usrp_source.h#n59

However, this only shows the end time when I stop the flow graph manually.
Is there a way in gnuradio that can read the system time during the running
of the program?

For example, the flow graph begins to run and receive → after 1000
samples have been received, output system time → the program continues to
run…

In addition, how to stop a grc flow graph automatically?

In the non-gui mode, you can set the option “run to completion”. The
flow graph will exit when the flow graph is “done”. Done can happen for
example when gr_head block sees all N inputs. See options block in grc.

-josh