<jupyter_start><jupyter_text><jupyter_code>import time
def time_it(func):
  def wrapper(*args, **kwargs):
    start = time.time()
    result = func(*args, **kwargs)
    end = time.time()
    time_taken = (end-start)*1000
    print(f'time_taken by {func} is {time_taken}')
    return result
  return wrapper
@time_it
def add(x,y):
  return x+y

@time_it
def deduct(x,y):
  return x-y


import numpy as np
a = np.arange(1,10000)*5
b = np.arange(1,10000)
add(a,b)
deduct(a,b)
a=2
b=4

# decorator function
def smart_div(func):
  def wrapper(a,b):
    if a<b:
      a,b = b,a
    return (func(a,b))
  return wrapper

@smart_div # decorating to call the updated functionality
def div(a,b):
  print(a/b)

#calling the div function
div(a,b)<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup