Skip to main content

A beautiful timer from ufomap by Daniel Duberg, nanobind by Qingwen Zhang

Project description

dztimer

A beautiful timer from ufomap by Daniel Duberg, nanobind by Qingwen Zhang.

Running on macOS, Windows and Linux, with Python Version >= 3.8.

TestDemo:

pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ dztimer
python3 -c 'import dztimer'

Quick Demo:

import dztimer
from time import sleep

timer = dztimer.Timing()
timer.start("Total")
timer[0].start("One Scan Cost")
for i in range(5):
    sleep(0.05 + i * 0.01)
timer[0].stop()

for i in range(5):
    timer[1].start("Second Scan Cost")
    sleep(0.08 + i * 0.01)
    timer[1].stop()
timer.print(random_colors=True, bold=True)

image

Build from source

git clone https://github.com/KTH-RPL/dztimer
cd dztimer
pip install .
python3 -c 'import dztimer'

Issue I met when write this package

  1. multiple platform support, especially for windows, there is an error: error C2668: 'fpclassify': ambiguous call to overloaded function,https://stackoverflow.com/questions/61646166/how-to-resolve-fpclassify-ambiguous-call-to-overloaded-function. It's turn out if you want to std::isnan() in windows, you need to include <cmath> and std::isnan(static_cast<double> (you_value)).
  2. If you use std::array except linux, you need to include #include <array> and std::array<int, 2> my_array; instead of std::array my_array;

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

dztimer-1.0.0-pp39-pypy39_pp73-win_amd64.whl (51.8 kB view hashes)

Uploaded PyPy Windows x86-64

dztimer-1.0.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (70.7 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

dztimer-1.0.0-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (73.4 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686

dztimer-1.0.0-pp39-pypy39_pp73-macosx_10_14_x86_64.whl (44.9 kB view hashes)

Uploaded PyPy macOS 10.14+ x86-64

dztimer-1.0.0-pp38-pypy38_pp73-win_amd64.whl (52.0 kB view hashes)

Uploaded PyPy Windows x86-64

dztimer-1.0.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (70.9 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

dztimer-1.0.0-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (73.5 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686

dztimer-1.0.0-pp38-pypy38_pp73-macosx_10_14_x86_64.whl (45.0 kB view hashes)

Uploaded PyPy macOS 10.14+ x86-64

dztimer-1.0.0-cp312-abi3-win_amd64.whl (51.6 kB view hashes)

Uploaded CPython 3.12+ Windows x86-64

dztimer-1.0.0-cp312-abi3-win32.whl (44.9 kB view hashes)

Uploaded CPython 3.12+ Windows x86

dztimer-1.0.0-cp312-abi3-musllinux_1_1_x86_64.whl (123.0 kB view hashes)

Uploaded CPython 3.12+ musllinux: musl 1.1+ x86-64

dztimer-1.0.0-cp312-abi3-musllinux_1_1_i686.whl (129.2 kB view hashes)

Uploaded CPython 3.12+ musllinux: musl 1.1+ i686

dztimer-1.0.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (71.0 kB view hashes)

Uploaded CPython 3.12+ manylinux: glibc 2.17+ x86-64

dztimer-1.0.0-cp312-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (73.6 kB view hashes)

Uploaded CPython 3.12+ manylinux: glibc 2.17+ i686

dztimer-1.0.0-cp312-abi3-macosx_11_0_arm64.whl (44.6 kB view hashes)

Uploaded CPython 3.12+ macOS 11.0+ ARM64

dztimer-1.0.0-cp312-abi3-macosx_10_14_x86_64.whl (45.5 kB view hashes)

Uploaded CPython 3.12+ macOS 10.14+ x86-64

dztimer-1.0.0-cp311-cp311-win_amd64.whl (53.4 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

dztimer-1.0.0-cp311-cp311-win32.whl (46.5 kB view hashes)

Uploaded CPython 3.11 Windows x86

dztimer-1.0.0-cp311-cp311-musllinux_1_1_x86_64.whl (125.6 kB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

dztimer-1.0.0-cp311-cp311-musllinux_1_1_i686.whl (131.3 kB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ i686

dztimer-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (73.3 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

dztimer-1.0.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (76.0 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686

dztimer-1.0.0-cp311-cp311-macosx_11_0_arm64.whl (46.4 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

dztimer-1.0.0-cp311-cp311-macosx_10_14_x86_64.whl (47.4 kB view hashes)

Uploaded CPython 3.11 macOS 10.14+ x86-64

dztimer-1.0.0-cp310-cp310-win_amd64.whl (53.5 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

dztimer-1.0.0-cp310-cp310-win32.whl (46.5 kB view hashes)

Uploaded CPython 3.10 Windows x86

dztimer-1.0.0-cp310-cp310-musllinux_1_1_x86_64.whl (125.7 kB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

dztimer-1.0.0-cp310-cp310-musllinux_1_1_i686.whl (131.5 kB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ i686

dztimer-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (73.4 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

dztimer-1.0.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (76.1 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686

dztimer-1.0.0-cp310-cp310-macosx_11_0_arm64.whl (46.5 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

dztimer-1.0.0-cp310-cp310-macosx_10_14_x86_64.whl (47.5 kB view hashes)

Uploaded CPython 3.10 macOS 10.14+ x86-64

dztimer-1.0.0-cp39-cp39-win_amd64.whl (53.8 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

dztimer-1.0.0-cp39-cp39-win32.whl (46.8 kB view hashes)

Uploaded CPython 3.9 Windows x86

dztimer-1.0.0-cp39-cp39-musllinux_1_1_x86_64.whl (125.9 kB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

dztimer-1.0.0-cp39-cp39-musllinux_1_1_i686.whl (131.7 kB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ i686

dztimer-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (73.6 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

dztimer-1.0.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (76.3 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686

dztimer-1.0.0-cp39-cp39-macosx_11_0_arm64.whl (46.7 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

dztimer-1.0.0-cp39-cp39-macosx_10_14_x86_64.whl (47.6 kB view hashes)

Uploaded CPython 3.9 macOS 10.14+ x86-64

dztimer-1.0.0-cp38-cp38-win_amd64.whl (53.8 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

dztimer-1.0.0-cp38-cp38-win32.whl (46.9 kB view hashes)

Uploaded CPython 3.8 Windows x86

dztimer-1.0.0-cp38-cp38-musllinux_1_1_x86_64.whl (125.6 kB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

dztimer-1.0.0-cp38-cp38-musllinux_1_1_i686.whl (131.2 kB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ i686

dztimer-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (73.4 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

dztimer-1.0.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl (75.8 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686

dztimer-1.0.0-cp38-cp38-macosx_11_0_arm64.whl (46.5 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

dztimer-1.0.0-cp38-cp38-macosx_10_14_x86_64.whl (47.5 kB view hashes)

Uploaded CPython 3.8 macOS 10.14+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page