Skip to main content

Fast, simple and accurate Python timing. Written in Rust.

PyPI Downloads PyPI Downloads

Installation

Install with pip.

$ python -m pip install tictoc

Usage

Import.

from tictoc import tic,toc

Begin timing with tic(), and stop with toc().

tic()
# some code
toc()

A call to tic() can be followed with multiple toc() calls. Each will print the time elapsed since the most recent tic() call.

tic()
time.sleep(3)
toc()
# >>> The elapsed time was 3.000132333 seconds.
time.sleep(3)
toc()
# >>> The elapsed time was 6.000383124 seconds.

For more complex timing operations, you can assign the output of tic() and pass it as an input to toc().

firstTic = tic()
time.sleep(3)
secondTic = tic()
time.sleep(1)
toc(firstTic)
# >>> The elapsed time was 4.000317251 seconds.
time.sleep(3)
toc(secondTic)
# >>> The elapsed time was 4.000312568 seconds.

Any call to toc() will print the elapsed time in seconds. You can save the results with full precision by assigning the output of toc().

tic()
# some code
results = toc()

The available units are:

results.nanos   # u128
results.micros  # u128
results.millis  # u128
results.seconds # f64

Full example

import time
from tictoc import tic,toc

tic()         # start timing
time.sleep(3) # sleep for 3 seconds
toc()         # stop timing
# >>> The elapsed time was 3.000132333 seconds.

firstTic = tic()
time.sleep(3)
secondTic = tic()
time.sleep(1)
toc(firstTic)
# >>> The elapsed time was 4.000317251 seconds.
time.sleep(3)
toc(secondTic)
# >>> The elapsed time was 4.000312568 seconds.

tic()
results = toc()
print(results.nanos)
# >>> 2825

Metadata

Release files for tictoc 0.2.1

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

Source distribution (sdist)

Source distribution for tictoc 0.2.1
File Size Uploaded Provenance Actions
tictoc-0.2.1.tar.gz 19.1 kB Without provenance Details for tictoc-0.2.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for tictoc 0.2.1
File Actions
tictoc-0.2.1-pp311-pypy311_pp73-win_amd64.whl PyPy 3.11 PyPy 3.11 7.3 Windows x86-64 Details for tictoc-0.2.1-pp311-pypy311_pp73-win_amd64.whl
tictoc-0.2.1-cp314-cp314t-win_arm64.whl CPython 3.14 CPython 3.14 free-threading Windows ARM64 Details for tictoc-0.2.1-cp314-cp314t-win_arm64.whl
tictoc-0.2.1-cp314-cp314t-win_amd64.whl CPython 3.14 CPython 3.14 free-threading Windows x86-64 Details for tictoc-0.2.1-cp314-cp314t-win_amd64.whl
tictoc-0.2.1-cp313-cp313t-win_arm64.whl CPython 3.13 CPython 3.13 free-threading Windows ARM64 Details for tictoc-0.2.1-cp313-cp313t-win_arm64.whl
tictoc-0.2.1-cp313-cp313t-win_amd64.whl CPython 3.13 CPython 3.13 free-threading Windows x86-64 Details for tictoc-0.2.1-cp313-cp313t-win_amd64.whl
tictoc-0.2.1-cp38-abi3-win_arm64.whl CPython 3.8 abi3 Windows ARM64 Details for tictoc-0.2.1-cp38-abi3-win_arm64.whl
tictoc-0.2.1-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details for tictoc-0.2.1-cp38-abi3-win_amd64.whl
tictoc-0.2.1-cp38-abi3-musllinux_1_2_x86_64.whl CPython 3.8 abi3 Linux musl 1.2+ x86-64 Details for tictoc-0.2.1-cp38-abi3-musllinux_1_2_x86_64.whl
tictoc-0.2.1-cp38-abi3-musllinux_1_2_i686.whl CPython 3.8 abi3 Linux musl 1.2+ x86-32 Details for tictoc-0.2.1-cp38-abi3-musllinux_1_2_i686.whl
tictoc-0.2.1-cp38-abi3-musllinux_1_2_aarch64.whl CPython 3.8 abi3 Linux musl 1.2+ ARM64 Details for tictoc-0.2.1-cp38-abi3-musllinux_1_2_aarch64.whl
tictoc-0.2.1-cp38-abi3-manylinux_2_34_i686.whl CPython 3.8 abi3 Linux glibc 2.34+ x86-32 Details for tictoc-0.2.1-cp38-abi3-manylinux_2_34_i686.whl
tictoc-0.2.1-cp38-abi3-manylinux_2_31_x86_64.whl CPython 3.8 abi3 Linux glibc 2.31+ x86-64 Details for tictoc-0.2.1-cp38-abi3-manylinux_2_31_x86_64.whl
tictoc-0.2.1-cp38-abi3-manylinux_2_31_aarch64.whl CPython 3.8 abi3 Linux glibc 2.31+ ARM64 Details for tictoc-0.2.1-cp38-abi3-manylinux_2_31_aarch64.whl
tictoc-0.2.1-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details for tictoc-0.2.1-cp38-abi3-macosx_11_0_arm64.whl
tictoc-0.2.1-cp38-abi3-macosx_10_12_x86_64.whl CPython 3.8 abi3 macOS 10.12+ x86-64 Details for tictoc-0.2.1-cp38-abi3-macosx_10_12_x86_64.whl

Total release size: 3.9 MB

Release files / tictoc-0.2.1.tar.gz

Download URL tictoc-0.2.1.tar.gz
Size 19.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a352a8e8cf887974a8afb3cc5f7d2351924a46ba5e5c92a739ce402c1d3b255a
BLAKE2b-256 checksum
How to use checksums
eab28cefd5b04000883279743e4ebe89093603e1c3a7a523b6c7cb8f9c90758f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0rc2

Release files / tictoc-0.2.1-pp311-pypy311_pp73-win_amd64.whl

Download URL tictoc-0.2.1-pp311-pypy311_pp73-win_amd64.whl
Size 136.5 kB
Tags PyPy 3.11 PyPy 3.11 7.3 Windows x86-64
SHA-256 checksum
How to use checksums
0f52d7f1c013624f5e1c599161cb2c7588ecc036b586405596b073539f0b0407
BLAKE2b-256 checksum
How to use checksums
a445e8df73e18abb46eb8f313900f1dc4bd5b7874963c7ddf7c900b1e2970bec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0rc2

Release files / tictoc-0.2.1-cp314-cp314t-win_arm64.whl

Download URL tictoc-0.2.1-cp314-cp314t-win_arm64.whl
Size 130.5 kB
Tags CPython 3.14 CPython 3.14 free-threading Windows ARM64
SHA-256 checksum
How to use checksums
0914979c5b6ee5f899354c02d613213d961a5a1545172d20a64dc2f00f3ecad8
BLAKE2b-256 checksum
How to use checksums
7f43c14dbc63bc0228ad03e8bb0c56a70f7b80d69e4a58bb84749259251db55a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0rc2

Release files / tictoc-0.2.1-cp314-cp314t-win_amd64.whl

Download URL tictoc-0.2.1-cp314-cp314t-win_amd64.whl
Size 136.0 kB
Tags CPython 3.14 CPython 3.14 free-threading Windows x86-64
SHA-256 checksum
How to use checksums
839ff48988d9e4bb99ccd3ec88f6bb3fcd9277122f39bfd37ff57954022ecdca
BLAKE2b-256 checksum
How to use checksums
6460efb939030eda10f7e43a1b1fbb03aa0ccf0383804ce8d62ee93ceaf09ab9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0rc2

Release files / tictoc-0.2.1-cp313-cp313t-win_arm64.whl

Download URL tictoc-0.2.1-cp313-cp313t-win_arm64.whl
Size 130.4 kB
Tags CPython 3.13 CPython 3.13 free-threading Windows ARM64
SHA-256 checksum
How to use checksums
8675ddcbc7e27a93cc12c4db1c20f309260f4c4f9198ae7272b270869e20b85b
BLAKE2b-256 checksum
How to use checksums
0c97645470c282cbd9b757b6596b4b06c2c9d2ac4163223ca3f6de62a60f0725
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0rc2

Release files / tictoc-0.2.1-cp313-cp313t-win_amd64.whl

Download URL tictoc-0.2.1-cp313-cp313t-win_amd64.whl
Size 135.9 kB
Tags CPython 3.13 CPython 3.13 free-threading Windows x86-64
SHA-256 checksum
How to use checksums
48af04b39480e822a5255e133c494ed69713c8c75806e408dfaae9f7603e5832
BLAKE2b-256 checksum
How to use checksums
1d8e23d0bb9ed2790d463aa23b2283e3b538ea337529bdde812e597a131c79fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0rc2

Release files / tictoc-0.2.1-cp38-abi3-win_arm64.whl

Download URL tictoc-0.2.1-cp38-abi3-win_arm64.whl
Size 136.0 kB
Tags CPython 3.8 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
26522eb57c38a47f24d54d1bac5d52647506d0e8fb6fce5e19c05866725ad489
BLAKE2b-256 checksum
How to use checksums
ad439eea34a2a856b2c083995cd75a421148dba6c0307742e2399efbe757d985
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0rc2

Release files / tictoc-0.2.1-cp38-abi3-win_amd64.whl

Download URL tictoc-0.2.1-cp38-abi3-win_amd64.whl
Size 141.3 kB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
7b3572dcf89ce67ab7626e4fe526102fd9b925ff0bd7a088b0e460259998e86d
BLAKE2b-256 checksum
How to use checksums
a479ae7b53893017f8c7af574f43f6917113cdbfd3fc625b747ac3777312442c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0rc2

Release files / tictoc-0.2.1-cp38-abi3-musllinux_1_2_x86_64.whl

Download URL tictoc-0.2.1-cp38-abi3-musllinux_1_2_x86_64.whl
Size 255.7 kB
Tags CPython 3.8 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
673d34c4eaa803640df8a15db6b8ecbe2b7fb242a5aede0790c75fca4b07b857
BLAKE2b-256 checksum
How to use checksums
c90c80ea525e2b3caac83e9aebdf8d734c2799ef6f04fbb7ea7d4ad7b1be4fa7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0rc2

Release files / tictoc-0.2.1-cp38-abi3-musllinux_1_2_i686.whl

Download URL tictoc-0.2.1-cp38-abi3-musllinux_1_2_i686.whl
Size 277.2 kB
Tags CPython 3.8 Linux musl 1.2+ x86-32 abi3
SHA-256 checksum
How to use checksums
1209179945a4b487ff1a21d49ad67775036c45012d1be72edddfe5a6327f1aca
BLAKE2b-256 checksum
How to use checksums
744e5c83ba796b3f0908f2c553736bf64798bae9587679a94316045a126cb4bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0rc2

Release files / tictoc-0.2.1-cp38-abi3-musllinux_1_2_aarch64.whl

Download URL tictoc-0.2.1-cp38-abi3-musllinux_1_2_aarch64.whl
Size 245.4 kB
Tags CPython 3.8 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
1997ba5a88a3a794f78aceeacf2ec014296d6ba7c536086d7fc825d9cbaa4700
BLAKE2b-256 checksum
How to use checksums
20dfe47100b41c84d2905d601c51de039f1772b601efb15b0f36c64b24b9f1a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0rc2

Release files / tictoc-0.2.1-cp38-abi3-manylinux_2_34_i686.whl

Download URL tictoc-0.2.1-cp38-abi3-manylinux_2_34_i686.whl
Size 284.5 kB
Tags CPython 3.8 Linux glibc 2.34+ x86-32 abi3
SHA-256 checksum
How to use checksums
e0cab3b3f57e744828460eee82aa54b29871e95543c19a67f2480ef91c6b5770
BLAKE2b-256 checksum
How to use checksums
edea842ac88a6e3c9cf0da6eb036401713bf05c017486076cea65ee787a5db06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0rc2

Release files / tictoc-0.2.1-cp38-abi3-manylinux_2_31_x86_64.whl

Download URL tictoc-0.2.1-cp38-abi3-manylinux_2_31_x86_64.whl
Size 257.1 kB
Tags CPython 3.8 Linux glibc 2.31+ x86-64 abi3
SHA-256 checksum
How to use checksums
2093f1025438843677da158b24d7c0be67c40db5f7bbc880a88bb761bdf308ca
BLAKE2b-256 checksum
How to use checksums
8c2c4f59656c875269a2338df9b9ae3a3d04c51630684de71c3cea2f2e68ad26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0rc2

Release files / tictoc-0.2.1-cp38-abi3-manylinux_2_31_aarch64.whl

Download URL tictoc-0.2.1-cp38-abi3-manylinux_2_31_aarch64.whl
Size 246.5 kB
Tags CPython 3.8 Linux glibc 2.31+ ARM64 abi3
SHA-256 checksum
How to use checksums
e4c19218aec01dad9946a27d670172b474d8c740f2f8fd1b021b40ca904f576f
BLAKE2b-256 checksum
How to use checksums
e15daaf6eabbdd7f54efbde0e43a54d66cf4647dacd46a116834bf560df201d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0rc2

Release files / tictoc-0.2.1-cp38-abi3-macosx_11_0_arm64.whl

Download URL tictoc-0.2.1-cp38-abi3-macosx_11_0_arm64.whl
Size 701.8 kB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1289905e4bf10e54d35a312ba9bcbc5cd665383ddcf23c0465666e6d174a4426
BLAKE2b-256 checksum
How to use checksums
e372bdde28672a8b938b74200d50aece5b4916d471dc4bf9209ca08f60017677
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0rc2

Release files / tictoc-0.2.1-cp38-abi3-macosx_10_12_x86_64.whl

Download URL tictoc-0.2.1-cp38-abi3-macosx_10_12_x86_64.whl
Size 710.0 kB
Tags CPython 3.8 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
ee65aa57c06a22f3156dcf615d0d9a905b846b6bd19fee2148b365ab10773708
BLAKE2b-256 checksum
How to use checksums
a307606b2d0e64caadb5fef560f57ddd1325450e4aea51ec22e16f44f35efc52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0rc2

Security for tictoc 0.2.1

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.

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