Skip to main content

Introduction

Provide sleep(secs) / time_s() functions. Fix overflow bugs in CPython implementation so far (v3.14.0a1).

sleep(secs)

Use clock_nanosleep() with CLOCK_MONOTONIC to sleep. So that the sleep is not affected by system date/time jumps.

On CPython 3.11+, time.sleep() function already use this method.

time_s()

Return time as an integer number of seconds since the epoch.

Usage

Only provide source code distribution, user need to install the build toolchain. It can’t be compiled on platforms without clock_nanosleep().

try:
    from clock_time import sleep, time_s
except ImportError:
    from time import sleep, time_ns
    def time_s():
        return time_ns() // 1_000_000_000

sleep(secs)
t = time_s()

Metadata

Release files for clock-time 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clock-time 1.0
File Size Uploaded Provenance Actions
clock_time-1.0.tar.gz 5.8 kB Without provenance Details for clock_time-1.0.tar.gz

Release files / clock_time-1.0.tar.gz

Download URL clock_time-1.0.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8a17f2740e7c09f4f5e699de783a45ba86f05ab4faee4f5b2744bf083eb20ba6
BLAKE2b-256 checksum
How to use checksums
085a1b73dc1658ecf0e6d0038cfcdcafa599af0fbc262f6ac1b90ff5d8b1cfff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.12

Security for clock-time 1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page