""" Provides decorator function "profile" that counts calls and cumulative execution time for all decorated functions for the duration of an interpreter session. """ __author__ = 'A student in CS 20P, someone@jeff.cis.cabrillo.edu' import time def profile(function): """ Decorates a function so that the number of calls and cumulative execution time of all calls can be reported by call_count() and cumulative_time(), respectively. Execution time is measured by calling time.perf_counter() before and after a call to the decorated function. """ pass # TODO def call_count(function): """ Returns the number of times a given function has been called during this interpreter session, assuming the function has been decorated by profile(). """ pass # TODO def call_counts(): """ Returns a dictionary mapping functions decorated by profile() to the number of times they have been called during this interpreter session. """ pass # TODO def cumulative_time(function): """ Returns the cumulative amount of time (in seconds) that have been spent executing calls to a given function during this interpreter session, assuming the function has been decorated by profile(). """ pass # TODO def cumulative_times(): """ Returns a dictionary mapping functions decorated by profile() to the cumulative amount of time (in seconds) that have been spent executing calls to a given function during this interpreter session. """ pass # TODO