Skip to content

Commit d1d58f2

Browse files
fix: use already imported instrument_hooks module for current_timestamp
1 parent 4852499 commit d1d58f2

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/pytest_codspeed/instruments/hooks/__init__.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,9 @@ def set_executed_benchmark(self, uri: str, pid: int | None = None) -> None:
8686
if ret != 0:
8787
warnings.warn("Failed to set executed benchmark", RuntimeWarning)
8888

89-
@staticmethod
90-
def current_timestamp() -> int:
89+
def current_timestamp(self) -> int:
9190
"""Return a monotonic timestamp in nanoseconds from the native library."""
92-
from . import dist_instrument_hooks # type: ignore
93-
94-
return dist_instrument_hooks.instrument_hooks_current_timestamp()
91+
return self._module.instrument_hooks_current_timestamp()
9592

9693
def add_marker(
9794
self, marker_type: int, timestamp: int, pid: int | None = None

0 commit comments

Comments
 (0)