Hii! I want to get the time execution of my function ( test(G) ). when I use Timer I need to write the type of my object : "test(% ?? )" %G which is DiGraph here. How can I do that?
from networkx import nx
def test(G):
for e in G.edges_iter():
print(e)
if __name__=='__main__':
from timeit import Timer
G = nx.DiGraph()
G.add_edges_from([(1,2),(4,5)])
t = Timer("test(% ?? )"%G,"from __main__ import test")
print( t.timeit(1))