Staging
v0.5.1
https://foss.heptapod.net/mercurial/hgview
Revision 5d92fc5d1991a557aec8e43eba9780b3d9771464 authored by Pierre-Yves David on 03 August 2012, 15:21:58 UTC, committed by Pierre-Yves David on 03 August 2012, 15:21:58 UTC
There is now Strong and Weak relation. Strong relation are normal parenship
relation as we know them today. Weak relation are going to be used for obsolete
relation.
1 parent bc542be
Raw File
Tip revision: 5d92fc5d1991a557aec8e43eba9780b3d9771464 authored by Pierre-Yves David on 03 August 2012, 15:21:58 UTC
[lib+gui] make the graph aware of two kind of relation
Tip revision: 5d92fc5
decorators.py
# -*- coding: utf-8 -*-
"""
Some useful decorator functions
"""
import time

def timeit(func):
    """Decorator used to time the execution of a function"""
    def timefunc(*args, **kwargs):
        """wrapper"""
        t_1 = time.time()
        t_2 = time.clock()
        res = func(*args, **kwargs)
        t_3 = time.clock()
        t_4 = time.time()
        print "%s: %.2fms (time) %.2fms (clock)" % \
              (func.func_name, 1000*(t_3 - t_2), 1000*(t_4 - t_1))
        return res
    return timefunc
back to top