def time_tracking_decorator(callable_obj):
        """Decorates given callable to track its time."""

        ### create a list wherein to store the intervals
        intervals = []

        ### define the wrapper function

        @wraps(callable_obj)
        def time_tracking_wrapper(*args, **kwargs):
            """Store execution time of wrapped callable.

            Also triggers the saving of such data when it
            reaches a predefined quantity.
            """
            ### store the start time
            start = current_time_func()

            ### execute wrapped callable w/ given arguments
            callable_obj(*args, **kwargs)

            ### store difference between current and
            ### start time
            intervals.append(current_time_func() - start)

            ### save intervals if the predefined quantity is
            ### reached

            if len(intervals) == quantity_at_which_to_save:

                save_intervals(intervals, filepath, profiling_title, solution_title)

        ### return the wrapper function
        return time_tracking_wrapper
Decorates given callable to track its time.
nodezator/ourstdlibs/profileutils.py