l#g@@ddlZddlmZddlmZGddZdS)N)contextmanager) TracebackTypecheZdZd dZdeedzdedzdedzddfdZede fdZ dS) BenchmarkreturnNc6tj|_|SN)time monotonic_ns start_timeselfs T/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/utils/benchmark.py __enter__zBenchmark.__enter__s+-- exc_typeexc_valexc_tbc^tj|_|j|jz |_dSr )r r end_timer elapsed_time_ns)rrrrs r__exit__zBenchmark.__exit__ s+ )++ #}t>rc|jdzS)Ngư>)rr s relapsed_time_mszBenchmark.elapsed_time_mss#d**r)rN) __name__ __module__ __qualname__rtype BaseExceptionrrpropertyfloatrrrrrs?}%,?%?$ ?  ????++++X+++rr)r contextlibrtypesrrr"rrr%sd %%%%%%++++++++++r