Wednesday, April 24, 2013

Time benchmarking of a GNU Radio flow graph

#!/usr/bin/env python
# my_benchmark.py


from gnuradio import gr


def top_block():
 fg = gr.top_block()
 src = gr.file_source(gr.sizeof_float, "input.dat")
 # your stuff here...
 dst = gr.file_sink(gr.sizeof_float, "output.dat")
 fg.connect(src, dst)
 return fg


if __name__ == '__main__':
 fg = build_graph()
 fg.run()


Then:

 $ time ./my_benchmark.py

And it will return the time time taken by your algorithm

No comments:

Post a Comment