measure(code_str, times=1, label=None)
The supplied code string is compiled with the Python builtin compile
. The precision of the timing is 10 milli-seconds. If the code will execute fast on this timescale, it can be executed many times to get reasonable timing accuracy.
The code to be timed.
The number of times the code is executed. Default is 1. The code is only compiled once.
A label to identify :None:None:`code_str`
with. This is passed into compile
as the second argument (for run-time error messages).
Total elapsed time in seconds for executing :None:None:`code_str`
:None:None:`times`
times.
Return elapsed time for executing code in the namespace of the caller.
>>> times = 10See :
... etime = np.testing.measure('for i in range(1000): np.sqrt(i**2)', times=times)
... print("Time for a single execution : ", etime / times, "s") # doctest: +SKIP Time for a single execution : 0.005 s
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them