관리-도구
편집 파일: benchmark.cpython-311.opt-1.pyc
� IMg@ � �@ � d dl Z d dlmZ d dlmZ G d� d� � ZdS )� N)�contextmanager)� TracebackTypec �h � e Zd Zd d�Zdee dz dedz dedz ddfd�Zede fd�� � Z dS ) � Benchmark�returnNc �6 � t j � � | _ | S �N)�time�monotonic_ns� start_time��selfs �T/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/utils/benchmark.py� __enter__zBenchmark.__enter__ s � ��+�-�-����� �exc_type�exc_val�exc_tbc �^ � t j � � | _ | j | j z | _ d S r )r r �end_timer �elapsed_time_ns)r r r r s r �__exit__zBenchmark.__exit__ s+ � � �)�+�+�� �#�}�t��>����r c � � | j dz S )Ng���ư>)r r s r �elapsed_time_mszBenchmark.elapsed_time_ms s � ��#�d�*�*r )r N)�__name__� __module__�__qualname__r �type� BaseExceptionr r �property�floatr � r r r r s� � � � � � �� � � �?��}�%��,�?� ��%�?� ��$� ?� �?� ?� ?� ?� �+�� +� +� +� �X�+� +� +r r )r � contextlibr �typesr r r"