How do I call cProfile from within a function, using it to call and profile another function?
I have a function start(), which is called from my webpage (using Django). In this function I place the cProfile call:
cProfile.run('my_function()')
This gives me the error "Name my_function is not defined". However, the function is called no problem if I just do a normal function call: my_function()
Everything says to execute the "main" function using cProfile, but I don't really have a single main function or an obvious way to run my program except from the webpage.