# Copyright (C) 2001-2025, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: # Matt Wang , 2025 msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2024-09-24 07:20+0000\n" "PO-Revision-Date: 2025-05-25 04:26+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../../c-api/time.rst:6 msgid "PyTime C API" msgstr "PyTime C API" #: ../../c-api/time.rst:10 msgid "" "The clock C API provides access to system clocks. It is similar to the " "Python :mod:`time` module." msgstr "時鐘 C API 提供對系統時鐘的存取。它類似於 Python 的 :mod:`time` 模組。" #: ../../c-api/time.rst:13 msgid "" "For C API related to the :mod:`datetime` module, see :ref:`datetimeobjects`." msgstr "" "對於與 :mod:`datetime` 模組相關的 C API,請參閱 :ref:`datetimeobjects`。" #: ../../c-api/time.rst:17 msgid "Types" msgstr "型別" #: ../../c-api/time.rst:21 msgid "" "A timestamp or duration in nanoseconds, represented as a signed 64-bit " "integer." msgstr "以奈秒為單位的時間戳記或持續時長,以有符號的 64 位元整數表示。" #: ../../c-api/time.rst:24 msgid "" "The reference point for timestamps depends on the clock used. For " "example, :c:func:`PyTime_Time` returns timestamps relative to the UNIX epoch." msgstr "" "時間戳記的參照點取決於所使用的時鐘。例如 :c:func:`PyTime_Time` 回傳相對於 " "UNIX 紀元 (UNIX epoch) 的時間戳記。" #: ../../c-api/time.rst:27 msgid "" "The supported range is around [-292.3 years; +292.3 years]. Using the Unix " "epoch (January 1st, 1970) as reference, the supported date range is around " "[1677-09-21; 2262-04-11]. The exact limits are exposed as constants:" msgstr "" "支援的範圍約為 [-292.3 年;+292.3 年]。以 Unix 紀元 (1970 年 1 月 1 日) 為參" "照,支援的日期範圍約為 [1677-09-21; 2262-04-11]。確切的限制是以常數的形式公開" "出來:" #: ../../c-api/time.rst:34 msgid "Minimum value of :c:type:`PyTime_t`." msgstr ":c:type:`PyTime_t` 的最小值。" #: ../../c-api/time.rst:38 msgid "Maximum value of :c:type:`PyTime_t`." msgstr ":c:type:`PyTime_t` 的最大值。" #: ../../c-api/time.rst:42 msgid "Clock Functions" msgstr "時鐘函式" #: ../../c-api/time.rst:44 msgid "" "The following functions take a pointer to a :c:expr:`PyTime_t` that they set " "to the value of a particular clock. Details of each clock are given in the " "documentation of the corresponding Python function." msgstr "" "以下的函式接受一個指向 :c:expr:`PyTime_t` 的指標,並將其設定為特定時鐘的值。" "每個時鐘的詳細資訊紀錄在相對應的 Python 函式說明文件中。" #: ../../c-api/time.rst:49 msgid "" "The functions return ``0`` on success, or ``-1`` (with an exception set) on " "failure." msgstr "函式成功時會回傳 ``0`` 或在失敗時回傳 ``-1``\\ (並設定一個例外)。" #: ../../c-api/time.rst:52 msgid "" "On integer overflow, they set the :c:data:`PyExc_OverflowError` exception " "and set ``*result`` to the value clamped to the ``[PyTime_MIN; PyTime_MAX]`` " "range. (On current systems, integer overflows are likely caused by " "misconfigured system time.)" msgstr "" "在整數溢位時,它們會設定 :c:data:`PyExc_OverflowError` 例外,並將 " "``*result`` 設定為夾在 ``[PyTime_MIN; PyTime_MAX]`` 範圍內的值。(在目前的系" "統上,整數溢位很可能是由於錯誤設定的系統時間所造成。)" #: ../../c-api/time.rst:58 msgid "" "As any other C API (unless otherwise specified), the functions must be " "called with the :term:`GIL` held." msgstr "" "如同任何其他 C API(除非另有指定),必須在持有 :term:`GIL` 的情況下呼叫函式。" #: ../../c-api/time.rst:63 msgid "" "Read the monotonic clock. See :func:`time.monotonic` for important details " "on this clock." msgstr "讀取單調時鐘。請參閱 :func:`time.monotonic` 取得此時鐘的重要詳細資訊。" #: ../../c-api/time.rst:68 msgid "" "Read the performance counter. See :func:`time.perf_counter` for important " "details on this clock." msgstr "" "讀取效能計數器。請參閱 :func:`time.perf_counter` 以取得此時鐘的重要詳細資訊。" #: ../../c-api/time.rst:73 msgid "" "Read the “wall clock” time. See :func:`time.time` for details important on " "this clock." msgstr "" "讀取「牆上時鐘 (wall clock)」的時間。請參閱 :func:`time.time` 以取得詳細資" "訊。" #: ../../c-api/time.rst:78 msgid "Raw Clock Functions" msgstr "原始時鐘函式" #: ../../c-api/time.rst:80 msgid "" "Similar to clock functions, but don't set an exception on error and don't " "require the caller to hold the GIL." msgstr "類似於時鐘函式,但不會在出錯時設定例外,也不需要讓呼叫者持有 GIL。" #: ../../c-api/time.rst:83 msgid "On success, the functions return ``0``." msgstr "成功時函式會回傳 ``0``。" #: ../../c-api/time.rst:85 msgid "" "On failure, they set ``*result`` to ``0`` and return ``-1``, *without* " "setting an exception. To get the cause of the error, acquire the GIL and " "call the regular (non-``Raw``) function. Note that the regular function may " "succeed after the ``Raw`` one failed." msgstr "" "失敗時,它們會將 ``*result`` 設為 ``0`` 並回傳 ``-1``, 而\\ *不*\\ 設定例外。" "要取得錯誤原因,請取得 GIL 並呼叫常規(非 ``Raw``)函式。請注意,常規函式可能" "會在 ``Raw`` 的函式失敗後成功。" #: ../../c-api/time.rst:92 msgid "" "Similar to :c:func:`PyTime_Monotonic`, but don't set an exception on error " "and don't require holding the GIL." msgstr "" "類似於 :c:func:`PyTime_Monotonic`,但不會在出錯時設定例外,也不需要持有 GIL。" #: ../../c-api/time.rst:97 msgid "" "Similar to :c:func:`PyTime_PerfCounter`, but don't set an exception on error " "and don't require holding the GIL." msgstr "" "類似於 :c:func:`PyTime_PerfCounter`,但不會在出錯時設定例外,也不需要持有 " "GIL。" #: ../../c-api/time.rst:102 msgid "" "Similar to :c:func:`PyTime_Time`, but don't set an exception on error and " "don't require holding the GIL." msgstr "" "類似於 :c:func:`PyTime_Time`,但不會在出錯時設定例外,也不需要持有 GIL。" #: ../../c-api/time.rst:107 msgid "Conversion functions" msgstr "轉換函式" #: ../../c-api/time.rst:111 msgid "Convert a timestamp to a number of seconds as a C :c:expr:`double`." msgstr "將時間戳記轉換為 C :c:expr:`double` 的秒數。" #: ../../c-api/time.rst:113 msgid "" "The function cannot fail, but note that :c:expr:`double` has limited " "accuracy for large values." msgstr "此函式不會失敗,但請注意 :c:expr:`double` 對於大數值的精確度有限。"