JustCaptain kod-buduschego
fb76709a56ac3b52d88ac79d26e74cc4267d61b2
Перейти к файлу
Код
kod-buduschego Python 2025-20264.4. Декораторpracticesteachbasetask_2.py
anc update c70a58f 8 октября 2026 г.
task_2.py
from time import sleep, time
from typing import Any


def timer(func: Any) -> Any:

    def wrapper(*args, **kwargs) -> Any:
        start_time = time()
        result = func(*args, **kwargs)
        print("Время работы функции: {}".format(time() - start_time))
        return result

    return wrapper


@timer
def slow_function(time_stop: int) -> None:
    sleep(time_stop)


slow_function(time_stop=10)