Use ``clock_nanosleep()`` with ``CLOCK_MONOTONIC`` to sleep. So that the sleep is not affected by system date/time jumps.
Only provide source code distribution, user need to install the build toolchain. It can't be compiled on platforms without ``clock_nanosleep()``.
On CPython 3.11+, `time.sleep() <https://docs.python.org/3/library/time.html#time.sleep>`_ function already use this method.
.. sourcecode:: python
try:
from clock_nanosleep import sleep
except ImportError:
from time import sleep
sleep(secs)
Raw data
{
"_id": null,
"home_page": "https://bitbucket.org/wjssz/clock_nanosleep",
"name": "clock-nanosleep",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.0",
"maintainer_email": null,
"keywords": "sleep",
"author": "Ma Lin",
"author_email": "malincns@163.com",
"download_url": "https://files.pythonhosted.org/packages/e9/64/70b14a9dd812c259a1dc85433491499d929a7c709331d68d242eac7768a6/clock_nanosleep-1.2.tar.gz",
"platform": null,
"description": "Use ``clock_nanosleep()`` with ``CLOCK_MONOTONIC`` to sleep. So that the sleep is not affected by system date/time jumps.\n\nOnly provide source code distribution, user need to install the build toolchain. It can't be compiled on platforms without ``clock_nanosleep()``.\n\nOn CPython 3.11+, `time.sleep() <https://docs.python.org/3/library/time.html#time.sleep>`_ function already use this method.\n\n.. sourcecode:: python\n\n try:\n from clock_nanosleep import sleep\n except ImportError:\n from time import sleep\n\n sleep(secs)\n",
"bugtrack_url": null,
"license": "The 3-Clause BSD License",
"summary": "sleep(secs) function that use clock_nanosleep() with CLOCK_MONOTONIC.",
"version": "1.2",
"project_urls": {
"Homepage": "https://bitbucket.org/wjssz/clock_nanosleep"
},
"split_keywords": [
"sleep"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e96470b14a9dd812c259a1dc85433491499d929a7c709331d68d242eac7768a6",
"md5": "b429fdb90f8ce37d925a3fa25fdb30d3",
"sha256": "e321a9be28394511a0330d81b09d5117513477acf25b7fafec6a2b51f3b5b886"
},
"downloads": -1,
"filename": "clock_nanosleep-1.2.tar.gz",
"has_sig": false,
"md5_digest": "b429fdb90f8ce37d925a3fa25fdb30d3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.0",
"size": 5076,
"upload_time": "2024-10-28T12:57:56",
"upload_time_iso_8601": "2024-10-28T12:57:56.210072Z",
"url": "https://files.pythonhosted.org/packages/e9/64/70b14a9dd812c259a1dc85433491499d929a7c709331d68d242eac7768a6/clock_nanosleep-1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-28 12:57:56",
"github": false,
"gitlab": false,
"bitbucket": true,
"codeberg": false,
"bitbucket_user": "wjssz",
"bitbucket_project": "clock_nanosleep",
"lcname": "clock-nanosleep"
}