mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-04 06:36:24 +00:00
Use our monotonic everywhere
Gives nicer times relative to process start time than the python stdlib monotonic
This commit is contained in:
parent
304c68ba6f
commit
ede332fecf
7 changed files with 10 additions and 9 deletions
|
|
@ -4,10 +4,10 @@
|
|||
|
||||
from collections import deque
|
||||
from contextlib import suppress
|
||||
from time import monotonic
|
||||
from types import TracebackType
|
||||
from typing import TYPE_CHECKING, Any, Callable, ContextManager, Deque, Dict, NamedTuple, Optional, Sequence, Type, Union, cast
|
||||
|
||||
from kitty.fast_data_types import monotonic
|
||||
from kitty.types import DecoratedFunc, ParsedShortcut
|
||||
from kitty.typing import (
|
||||
AbstractEventLoop,
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
#!/usr/bin/env python
|
||||
# License: GPLv3 Copyright: 2021, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
from time import monotonic
|
||||
from typing import Dict, Sequence
|
||||
|
||||
from kitty.fast_data_types import monotonic
|
||||
from kitty.typing import TypedDict
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ from contextlib import contextmanager, suppress
|
|||
from functools import partial
|
||||
from gettext import gettext as _
|
||||
from gettext import ngettext
|
||||
from time import monotonic, sleep
|
||||
from time import sleep
|
||||
from typing import (
|
||||
TYPE_CHECKING,
|
||||
Any,
|
||||
|
|
@ -93,6 +93,7 @@ from .fast_data_types import (
|
|||
global_font_size,
|
||||
last_focused_os_window_id,
|
||||
mark_os_window_for_close,
|
||||
monotonic,
|
||||
os_window_focus_counters,
|
||||
os_window_font_size,
|
||||
patch_global_colors,
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@ from enum import Enum, auto
|
|||
from functools import partial
|
||||
from gettext import gettext as _
|
||||
from itertools import count
|
||||
from time import monotonic, time_ns
|
||||
from time import time_ns
|
||||
from typing import IO, Any, Callable, DefaultDict, Deque, Dict, Iterable, Iterator, List, Optional, Tuple, Union
|
||||
|
||||
from kittens.transfer.utils import IdentityCompressor, ZlibCompressor, abspath, expand_home, home_path
|
||||
from kitty.fast_data_types import ESC_OSC, FILE_TRANSFER_CODE, AES256GCMDecrypt, add_timer, base64_decode, base64_encode, get_boss, get_options
|
||||
from kitty.fast_data_types import ESC_OSC, FILE_TRANSFER_CODE, AES256GCMDecrypt, add_timer, base64_decode, base64_encode, get_boss, get_options, monotonic
|
||||
from kitty.types import run_once
|
||||
|
||||
from .utils import log_error
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import re
|
|||
import sys
|
||||
from contextlib import suppress
|
||||
from functools import lru_cache, partial
|
||||
from time import monotonic, time_ns
|
||||
from time import time_ns
|
||||
from types import GeneratorType
|
||||
from typing import (
|
||||
TYPE_CHECKING,
|
||||
|
|
@ -34,6 +34,7 @@ from .fast_data_types import (
|
|||
EllipticCurveKey,
|
||||
get_boss,
|
||||
get_options,
|
||||
monotonic,
|
||||
read_command_response,
|
||||
send_data_to_peer,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ from collections import deque
|
|||
from contextlib import suppress
|
||||
from gettext import gettext as _
|
||||
from operator import attrgetter
|
||||
from time import monotonic
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
|
|
@ -45,6 +44,7 @@ from .fast_data_types import (
|
|||
get_options,
|
||||
last_focused_os_window_id,
|
||||
mark_tab_bar_dirty,
|
||||
monotonic,
|
||||
next_window_id,
|
||||
remove_tab,
|
||||
remove_window,
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import string
|
|||
import sys
|
||||
from contextlib import contextmanager, suppress
|
||||
from functools import lru_cache
|
||||
from time import monotonic
|
||||
from typing import (
|
||||
TYPE_CHECKING,
|
||||
Any,
|
||||
|
|
@ -43,7 +42,7 @@ from .constants import (
|
|||
shell_path,
|
||||
ssh_control_master_template,
|
||||
)
|
||||
from .fast_data_types import WINDOW_FULLSCREEN, WINDOW_MAXIMIZED, WINDOW_MINIMIZED, WINDOW_NORMAL, Color, Shlex, get_options, open_tty
|
||||
from .fast_data_types import WINDOW_FULLSCREEN, WINDOW_MAXIMIZED, WINDOW_MINIMIZED, WINDOW_NORMAL, Color, Shlex, get_options, monotonic, open_tty
|
||||
from .rgb import to_color
|
||||
from .types import run_once
|
||||
from .typing import AddressFamily, PopenType, Socket, StartupCtx
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue