'Runs the callback repetitively and returns the average time.'

def TimeIt(self, callback, name=None, repetitions=None, pre=None, **kwargs):

    if (repetitions is None):
        repetitions = self.REPEATS
    if (name is None):
        name = callback.__name__
    if (pre is not None):
        pre()
    start = time.time()
    for _ in xrange(repetitions):
        return_value = callback(**kwargs)
    time_taken = ((time.time() - start) / repetitions)
    self.AddResult(name, time_taken, repetitions, return_value)
