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.

Install:

pip install 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)
    print("latest one cost:",timer[1].lastSeconds())
    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.1.0-pp310-pypy310_pp73-win_amd64.whl (54.7 kB view hashes)

Uploaded PyPy Windows x86-64

dztimer-1.1.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (74.4 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

dztimer-1.1.0-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (77.5 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686

dztimer-1.1.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl (46.4 kB view hashes)

Uploaded PyPy macOS 11.0+ ARM64

dztimer-1.1.0-pp310-pypy310_pp73-macosx_10_14_x86_64.whl (48.0 kB view hashes)

Uploaded PyPy macOS 10.14+ x86-64

dztimer-1.1.0-pp39-pypy39_pp73-win_amd64.whl (54.7 kB view hashes)

Uploaded PyPy Windows x86-64

dztimer-1.1.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (74.4 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

dztimer-1.1.0-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (77.5 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686

dztimer-1.1.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl (46.4 kB view hashes)

Uploaded PyPy macOS 11.0+ ARM64

dztimer-1.1.0-pp39-pypy39_pp73-macosx_10_14_x86_64.whl (48.0 kB view hashes)

Uploaded PyPy macOS 10.14+ x86-64

dztimer-1.1.0-pp38-pypy38_pp73-win_amd64.whl (54.8 kB view hashes)

Uploaded PyPy Windows x86-64

dztimer-1.1.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (74.6 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

dztimer-1.1.0-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (77.5 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686

dztimer-1.1.0-pp38-pypy38_pp73-macosx_11_0_arm64.whl (46.5 kB view hashes)

Uploaded PyPy macOS 11.0+ ARM64

dztimer-1.1.0-pp38-pypy38_pp73-macosx_10_14_x86_64.whl (48.1 kB view hashes)

Uploaded PyPy macOS 10.14+ x86-64

dztimer-1.1.0-cp312-abi3-win_amd64.whl (54.7 kB view hashes)

Uploaded CPython 3.12+ Windows x86-64

dztimer-1.1.0-cp312-abi3-win32.whl (49.1 kB view hashes)

Uploaded CPython 3.12+ Windows x86

dztimer-1.1.0-cp312-abi3-musllinux_1_1_x86_64.whl (126.9 kB view hashes)

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

dztimer-1.1.0-cp312-abi3-musllinux_1_1_i686.whl (132.9 kB view hashes)

Uploaded CPython 3.12+ musllinux: musl 1.1+ i686

dztimer-1.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (74.5 kB view hashes)

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

dztimer-1.1.0-cp312-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (77.3 kB view hashes)

Uploaded CPython 3.12+ manylinux: glibc 2.17+ i686

dztimer-1.1.0-cp312-abi3-macosx_11_0_arm64.whl (46.7 kB view hashes)

Uploaded CPython 3.12+ macOS 11.0+ ARM64

dztimer-1.1.0-cp312-abi3-macosx_10_14_x86_64.whl (49.1 kB view hashes)

Uploaded CPython 3.12+ macOS 10.14+ x86-64

dztimer-1.1.0-cp311-cp311-win_amd64.whl (56.5 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

dztimer-1.1.0-cp311-cp311-win32.whl (50.5 kB view hashes)

Uploaded CPython 3.11 Windows x86

dztimer-1.1.0-cp311-cp311-musllinux_1_1_x86_64.whl (130.1 kB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

dztimer-1.1.0-cp311-cp311-musllinux_1_1_i686.whl (136.0 kB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ i686

dztimer-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (77.6 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

dztimer-1.1.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (80.7 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686

dztimer-1.1.0-cp311-cp311-macosx_11_0_arm64.whl (49.1 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

dztimer-1.1.0-cp311-cp311-macosx_10_14_x86_64.whl (51.6 kB view hashes)

Uploaded CPython 3.11 macOS 10.14+ x86-64

dztimer-1.1.0-cp310-cp310-win_amd64.whl (56.7 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

dztimer-1.1.0-cp310-cp310-win32.whl (50.6 kB view hashes)

Uploaded CPython 3.10 Windows x86

dztimer-1.1.0-cp310-cp310-musllinux_1_1_x86_64.whl (130.3 kB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

dztimer-1.1.0-cp310-cp310-musllinux_1_1_i686.whl (136.2 kB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ i686

dztimer-1.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (77.7 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

dztimer-1.1.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (80.8 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686

dztimer-1.1.0-cp310-cp310-macosx_11_0_arm64.whl (49.2 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

dztimer-1.1.0-cp310-cp310-macosx_10_14_x86_64.whl (51.6 kB view hashes)

Uploaded CPython 3.10 macOS 10.14+ x86-64

dztimer-1.1.0-cp39-cp39-win_amd64.whl (57.1 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

dztimer-1.1.0-cp39-cp39-win32.whl (51.0 kB view hashes)

Uploaded CPython 3.9 Windows x86

dztimer-1.1.0-cp39-cp39-musllinux_1_1_x86_64.whl (130.5 kB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

dztimer-1.1.0-cp39-cp39-musllinux_1_1_i686.whl (136.5 kB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ i686

dztimer-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (78.0 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

dztimer-1.1.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (81.0 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686

dztimer-1.1.0-cp39-cp39-macosx_11_0_arm64.whl (49.3 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

dztimer-1.1.0-cp39-cp39-macosx_10_14_x86_64.whl (51.8 kB view hashes)

Uploaded CPython 3.9 macOS 10.14+ x86-64

dztimer-1.1.0-cp38-cp38-win_amd64.whl (56.8 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

dztimer-1.1.0-cp38-cp38-win32.whl (50.8 kB view hashes)

Uploaded CPython 3.8 Windows x86

dztimer-1.1.0-cp38-cp38-musllinux_1_1_x86_64.whl (130.0 kB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

dztimer-1.1.0-cp38-cp38-musllinux_1_1_i686.whl (135.7 kB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ i686

dztimer-1.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (77.5 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

dztimer-1.1.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl (80.3 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686

dztimer-1.1.0-cp38-cp38-macosx_11_0_arm64.whl (48.8 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

dztimer-1.1.0-cp38-cp38-macosx_10_14_x86_64.whl (51.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