import time

API_CALLS_MADE = 0
API_CALLS_MADE_DAILY = 0

# Class to color the output of the terminal, untested on Windows or Mac.
class bcolors:
    HEADER = '\033[95m'
    OKBLUE = '\033[94m'
    OKCYAN = '\033[96m'
    OKGREEN = '\033[92m'
    WARNING = '\033[93m'
    FAIL = '\033[91m'
    ENDC = '\033[0m'
    BOLD = '\033[1m'
    UNDERLINE = '\033[4m'

def st_time(func):
    """
        st decorator to calculate the total time of a func
    """

    def st_func(*args, **keyArgs):
        t1 = time.time()
        r = func(*args, **keyArgs)
        t2 = time.time()
        print (f"{bcolors.OKGREEN}Function=%s, Time=%s{bcolors.ENDC}" % (func.__name__, t2 - t1))
        return r

    return st_func