Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
timer.py provides convenient functions to measure time in Python.
pip install timer.py
from time import sleep
from timer_py import Timer
timer = Timer()
timer.start()
# Or:
# timer = Timer(start=True)
# A one-second process
sleep(1)
# Printing the elapsed time. The timer will continue to run.
timer.elapsed()
# Output:
# [timer.py] 00:00:01.001
timer.pause()
# A one-second process that won't be counted while the timer is paused.
sleep(1)
timer.resume()
# Another one-second process.
sleep(1)
# Overriding the tag for one time only (the original tag will still be remembered).
timer.elapsed('Checkpoint 1')
# Output:
# [Checkpoint 1] 00:00:02.002
timer.set_tag('Custom title')
timer.restart()
# Another one-second process.
sleep(1)
# Storing the elapsed time to a variable as a float while hiding the output.
elapsed = timer.elapsed(print=False)
print(elapsed)
# Output:
# 00:00:01.001
timer.stop()
# Output:
# [Custom title] 00:00:01.001
FAQs
Easy and accurate timer for Python.
We found that timer.py 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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.