Scripting Plugin - timeit module
Posted: 22 Jan 2013 23:14
I would like to time the execution of a layout algorithm to see how long it takes to load a graph. In order to do this, I'm trying to use the timeit module. The problem is that I think I need to import the code containing the runLayout() function into timeit, and I don't know where it's located. When I run the following code, I get an error:
Here is the error:
Code: Select all
import timeit
t = timeit.Timer('runLayout(YifanHuMultiLevel)', "from org.gephi import gephi")
t.timeit(1)
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Users\myusername\AppData\Roaming\.gephi\0.8.1\dev\modules\ext\gython.jar\Lib\timeit.py", line 164, in timeit
timing = self.inner(it, self.timer)
File "<timeit-src>", line 3, in inner
ImportError: cannot import name gephi