
Security News
Node.js Moves Toward Stable TypeScript Support with Amaro 1.0
Amaro 1.0 lays the groundwork for stable TypeScript support in Node.js, bringing official .ts loading closer to reality.
Singleton implementation of a timer. This package allows you to measure and summarize executions time.
> pip(3) install (-U) jdutimer
def add(self, func, *args)
... to measure the execution time of function.
def pack(self, title)
... to put all previous measured functions in a block with a given title.
def show_block(self, id=-1, unit="ms")
... to show execution time of a given block. The id can either be an integer, or a string. Display unit (s, ds, cs, ms) can be modified.
def show(self, unit="ms")
... to show all execution time blocks. Display unit (s, ds, cs, ms) can be modified.
def rename(self, old, new)
... to rename a given block. old can be the id or the name of the block to rename, new has to be a string.
This snippet :
from jdutimer.timer import Timer
def foo(str):
print(str)
def bar(num):
print(num)
timer = Timer()
timer.add(foo, "Hello World!")
timer.add(bar, 42)
timer.pack("Display")
timer.show()
Shows this in the console :
Hello World!
42
Display
foo 0.04ms
bar 0.01ms
0.04ms
-----
TOTAL 0.04ms
FAQs
A usefull timer package to measure and pack functions' execution time.
We found that jdutimer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Amaro 1.0 lays the groundwork for stable TypeScript support in Node.js, bringing official .ts loading closer to reality.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.