2 from types import SimpleNamespace
3 from typing import Any, NamedTuple, Tuple
4 from typing_extensions import final
6 _TimeTuple = Tuple[int, int, int, int, int, int, int, int, int]
11 tzname: tuple[str, str]
13 if sys.version_info >= (3, 7):
14 if sys.platform == "linux":
16 if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darwin":
17 CLOCK_PROF: int # FreeBSD, NetBSD, OpenBSD
18 CLOCK_UPTIME: int # FreeBSD, OpenBSD
20 if sys.platform != "win32":
22 CLOCK_MONOTONIC_RAW: int
23 CLOCK_PROCESS_CPUTIME_ID: int
25 CLOCK_THREAD_CPUTIME_ID: int
26 if sys.platform != "linux" and sys.platform != "darwin":
27 CLOCK_HIGHRES: int # Solaris only
29 if sys.version_info >= (3, 8) and sys.platform == "darwin":
32 if sys.version_info >= (3, 9) and sys.platform == "linux":
35 class _struct_time(NamedTuple):
46 def n_fields(self) -> int: ...
48 def n_sequence_fields(self) -> int: ...
50 def n_unnamed_fields(self) -> int: ...
53 class struct_time(_struct_time):
56 o: tuple[int, int, int, int, int, int, int, int, int]
57 | tuple[int, int, int, int, int, int, int, int, int, str]
58 | tuple[int, int, int, int, int, int, int, int, int, str, int],
63 o: tuple[int, int, int, int, int, int, int, int, int]
64 | tuple[int, int, int, int, int, int, int, int, int, str]
65 | tuple[int, int, int, int, int, int, int, int, int, str, int],
69 def tm_zone(self) -> str: ...
71 def tm_gmtoff(self) -> int: ...
73 def asctime(t: _TimeTuple | struct_time = ...) -> str: ...
75 if sys.version_info < (3, 8):
76 def clock() -> float: ...
78 def ctime(secs: float | None = ...) -> str: ...
79 def gmtime(secs: float | None = ...) -> struct_time: ...
80 def localtime(secs: float | None = ...) -> struct_time: ...
81 def mktime(t: _TimeTuple | struct_time) -> float: ...
82 def sleep(secs: float) -> None: ...
83 def strftime(format: str, t: _TimeTuple | struct_time = ...) -> str: ...
84 def strptime(string: str, format: str = ...) -> struct_time: ...
85 def time() -> float: ...
87 if sys.platform != "win32":
88 def tzset() -> None: ... # Unix only
90 def get_clock_info(name: str) -> SimpleNamespace: ...
91 def monotonic() -> float: ...
92 def perf_counter() -> float: ...
93 def process_time() -> float: ...
95 if sys.platform != "win32":
96 def clock_getres(clk_id: int) -> float: ... # Unix only
97 def clock_gettime(clk_id: int) -> float: ... # Unix only
98 def clock_settime(clk_id: int, time: float) -> None: ... # Unix only
100 if sys.version_info >= (3, 7):
101 if sys.platform != "win32":
102 def clock_gettime_ns(clock_id: int) -> int: ...
103 def clock_settime_ns(clock_id: int, time: int) -> int: ...
104 def monotonic_ns() -> int: ...
105 def perf_counter_ns() -> int: ...
106 def process_time_ns() -> int: ...
107 def time_ns() -> int: ...
108 def thread_time() -> float: ...
109 def thread_time_ns() -> int: ...