I wrote a function that returns a dictionary with statistics (memory usage, time, speed) based on another function that copies files/folders. I want to check if this is a good method or if you have any other suggestions or methods to improve it.def get_copy_stats(funct, args):    stats = {}    mem_usg_bef = get_process_memory_usage(process.exe) #process of the app I am testing    time_bef = timer()    size = funct(*args) #calls the function that copies the file and returns the file/folder size    time_aft = timer()    mem_usg_aft = get_process_memory_usage(process.exe)    stats['copy_time'] = time_aft-time_bef    stats['copy_speed'] = size/(time_aft-time_bef)    stats['mem_usg_bef'] = mem_usg_bef    stats['mem_usg_aft'] = mem_usg_aft    return statsExample on how to call it:get_copy_stats(copy_files,(C:\Users\me\Desktop\Source,C:\Users\me\Desktop\Dest))
Python function that returns statistics based on copy file action
python;benchmarking