Sindbad~EG File Manager

Current Path : /proc/thread-self/root/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/utils/
Upload File :
Current File : //proc/thread-self/root/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/utils/benchmark.py

import time
from contextlib import contextmanager
from types import TracebackType


class Benchmark:
    def __enter__(self) -> None:
        self.start_time = time.monotonic_ns()
        return self

    def __exit__(
        self,
        exc_type: type[BaseException] | None,
        exc_val: BaseException | None,
        exc_tb: TracebackType | None,
    ) -> None:
        self.end_time = time.monotonic_ns()
        self.elapsed_time_ns = self.end_time - self.start_time

    @property
    def elapsed_time_ms(self) -> float:
        return self.elapsed_time_ns * 1e-6

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists