| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,6 +31,7 @@ def build(setup_kwargs: Any) -> None: | |||
| 31 | 31 | "src/zeroconf/_protocol/outgoing.py", | |
| 32 | 32 | "src/zeroconf/_handlers/record_manager.py", | |
| 33 | 33 | "src/zeroconf/_services/registry.py", | |
| 34 | + "src/zeroconf/_utils/time.py", | ||
| 34 | 35 | ], | |
| 35 | 36 | compiler_directives={"language_level": "3"}, # Python 3 | |
| 36 | 37 | ), | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,13 +1,13 @@ | |||
| 1 | 1 | ||
| 2 | 2 | import cython | |
| 3 | 3 | ||
| 4 | + from ._protocol.incoming cimport DNSIncoming | ||
| 5 | + from ._utils.time cimport current_time_millis, millis_to_seconds | ||
| 6 | + | ||
| 4 | 7 | ||
| 5 | - cdef object millis_to_seconds | ||
| 6 | 8 | cdef object log | |
| 7 | 9 | cdef object logging_DEBUG | |
| 8 | 10 | ||
| 9 | - from ._protocol.incoming cimport DNSIncoming | ||
| 10 | - | ||
| 11 | 11 | ||
| 12 | 12 | cdef class AsyncListener: | |
| 13 | 13 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,4 @@ | |||
| 1 | + | ||
| 2 | + cpdef current_time_millis() | ||
| 3 | + | ||
| 4 | + cpdef millis_to_seconds(object millis) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,6 +23,8 @@ | |||
| 23 | 23 | ||
| 24 | 24 | import time | |
| 25 | 25 | ||
| 26 | + _float = float | ||
| 27 | + | ||
| 26 | 28 | ||
| 27 | 29 | def current_time_millis() -> float: | |
| 28 | 30 | """Current time in milliseconds. | |
@@ -33,6 +35,6 @@ def current_time_millis() -> float: | |||
| 33 | 35 | return time.monotonic() * 1000 | |
| 34 | 36 | ||
| 35 | 37 | ||
| 36 | - def millis_to_seconds(millis: float) -> float: | ||
| 38 | + def millis_to_seconds(millis: _float) -> float: | ||
| 37 | 39 | """Convert milliseconds to seconds.""" | |
| 38 | 40 | return millis / 1000.0 | |
| Back | FazBrowse Home | New Git URL |
0 commit comments