from timeit import default_timer as timer

from python_async.asynch import get_responses_async
from python_async.synch import get_responses


def run_async(range_max):
    start = timer()
    get_responses_async(range_max)
    end = timer()
    result = end - start
    return result


def run_sync(range_max):
    start = timer()
    get_responses(range_max)
    end = timer()
    result = end - start
    return result


def run_both():
    range_max = 50
    async_result = run_async(range_max)
    sync_result = run_sync(range_max)
    print("final results:")
    print(async_result)
    print(sync_result)
