def _ask_for_time_input(unit: str, lower_lim: int, upper_lim: int) -> int:
    """
    Input prompting generalized for seconds, minutes, hours, and days.

    Parameters
    ----------
    unit : str
        'seconds', 'minutes', 'hours', or 'days'.
    
    lower_lim : int
        Lower allowed limit for the unit input.

    upper_lim : int
        Upper allowed limit for the unit input.

    Returns
    -------
    ans : int
        User input for the unit within the limits.
    """
    while True:
        try:
            ans = int(input(f"Number of {unit}: "))
        except ValueError:
            print("Only integers are allowed!")
            continue
        
        if lower_lim <= ans <= upper_lim:
            return ans
        else:
            print(f"The number of {unit} must be in the interval [{lower_lim}, {upper_lim}]")
            continue