I've been trying to figure this out for a while now and I haven't been able to. Basically what I want to do is get the Time it takes to complete a specific task.
For Example:
def find(x):
if x in stuff:
return "X was found, Search Time: [TIME IT TOOK]"
I would like it to be something like "Search Time: 0.03 seconds". This is a really bad example but it's midnight and i'm trying to complete a python project for school so all answers are greatly appreciated.
Thanks