import requests
import time

def main():
    url = input("Enter API URL: ")
    interval = int(input("Check every (seconds): "))

    print(f"\nMonitoring {url}...\n")

    while True:
        try:
            start = time.time()
            res = requests.get(url)
            end = time.time()

            print(f"Status: {res.status_code} | Time: {round(end-start, 2)}s")
        except:
            print("Error")

        time.sleep(interval)
