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
O(log(n))or whatever. I think its about time in seconds or microseconds.timeitis the right direction but it would be nice to see the best way of using it and saving the result at the same time