예제 #1
0
def runctx(cmd,globals=None,locals=None,nruns=200):
    """
        Runs the command @cmd with with the given @globlas and @locals
        and collects profile data. The command is run @nruns (200 by default) and
        the data is averaged over these runs. Returns
        a Stats object with the collected data.
    """
    _locals = locals or {}
    _globals = globals or {}
    _profile.start()
    _profile.run(cmd,_globals,_locals,nruns)
    _profile.stop()
    return Stats(_profile.data,nruns)
예제 #2
0
def runctx(cmd,globals=None,locals=None,nruns=200):
    """
        Runs the command @cmd with with the given @globlas and @locals
        and collects profile data. The command is run @nruns (200 by default) and
        the data is averaged over these runs. Returns
        a Stats object with the collected data.
    """
    _locals = locals or {}
    _globals = globals or {}
    _profile.start()
    _profile.run(cmd,_globals,_locals,nruns)
    _profile.stop()
    return Stats(_profile.data,nruns)
예제 #3
0
 def runctx(self,cmd,globals,locals,nruns=200):
     """
         Runs the command @cmd with the given @globlas and @locals
         and collects profile data. The command is run @ntimes (200 by default) and
         the data is averaged over these runs.
     """
     _profile.stop()
     _profile.clear()
     _profile.start()
     for i in range(nruns):
         _profile.run(cmd,globals=globals,locals=locals)
     _profile.stop()
     self._profile = Stats(_profile.data,nruns)
예제 #4
0
 def runctx(self,cmd,globals,locals,nruns=200):
     """
         Runs the command @cmd with the given @globlas and @locals
         and collects profile data. The command is run @ntimes (200 by default) and
         the data is averaged over these runs.
     """
     _profile.stop()
     _profile.clear()
     _profile.start()
     for i in range(nruns):
         _profile.run(cmd,globals=globals,locals=locals)
     _profile.stop()
     self._profile = Stats(_profile.data,nruns)