We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 810a309 commit 73d3ab9Copy full SHA for 73d3ab9
2 files changed
src/zeroconf/_utils/time.pxd
@@ -1,4 +1,4 @@
1
2
cpdef double current_time_millis()
3
4
-cpdef millis_to_seconds(object millis)
+cpdef millis_to_seconds(double millis)
src/zeroconf/_utils/time.py
@@ -26,15 +26,17 @@
26
_float = float
27
28
29
-def current_time_millis() -> float:
+def current_time_millis() -> _float:
30
"""Current time in milliseconds.
31
32
The current implemention uses `time.monotonic`
33
but may change in the future.
34
+
35
+ The design requires the time to match asyncio.loop.time()
36
"""
37
return time.monotonic() * 1000
38
39
-def millis_to_seconds(millis: _float) -> float:
40
+def millis_to_seconds(millis: _float) -> _float:
41
"""Convert milliseconds to seconds."""
42
return millis / 1000.0
0 commit comments