šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

clockwise

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clockwise

A simple timing library for Python

1.0.4
PyPI
Maintainers
1

clockwise šŸ•°ļø

Simple but expressive timing package in Python

Installation

pip install clockwise

Minimal Example

import clockwise

@clockwise.timing("time-as-decorator")
def foo(a: int): 
   return a + 4

def main():
    for i in range(10):
        foo(i)

    with clockwise.timing_context("time-as-context"):
        foo(1)

    clockwise.print_timings() 

if __name__ == '__main__':
    main()

Debug Mode

The profiling is skipped when running in optimized mode using the -O or -OO tags.

Keywords

profiling

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts