0

I have two methods foo1 and foo2 running in an infinite loop, based on an if condition. I want to know how much time does each function consumes untill the loop breaks?

while(x):
    if y:
        foo1()
    else:
        foo2()

    update(x,y)
  • No Its not duplicate. I have to find out time elapsed bw two functions. not the time that elapsed by the while – Muhammad Ahmad Aug 26 '19 at 03:57
  • 1
    You can wrap each function in timer calls and accumulate the values representing each elapsed time per call onto two numbers. It seems like a small extrapolation upon the basic elapsed time code to me. – ggorlen Aug 26 '19 at 03:59

0 Answers0