
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
code-timer
Advanced tools
Simple python timer to use for single lines of code, or entire functions/classes
code_timer.Timer as a class, context manager, decorator
code_timer.timer decoratorcode_timer.timeit decorator to measure the time to run the same function multiple times
code_timer.TimerAs a class:
t = Timer(name="class")
t.start()
# Do something
t.stop()
As a context manager:
Useful when trying to time a recursive function
with Timer(name="context manager") as t:
# Do something
print(f"Elapsed time: {t.elapsed_time}")
As a decorator:
@Timer(name="decorator")
def stuff():
# Do something
code_timer.timerWithout braces
@timer
def your_func():
# Do something
With braces
@timer(name="my_timer")
def your_func():
# Do something
code_timer.timeit@timeit
def your_func():
# Do something
2020-03-12 21:56:46: code_timer.INFO - Best 3 of 10000 for your_func: 0.2200 ms; 0.2220 ms; 0.2232 ms@timeit(num_repeats=50)
def your_func():
# Do something
2020-03-12 21:56:46: code_timer.INFO - Best 3 of 50 for your_func: 0.2200 ms; 0.2220 ms; 0.2232 msFAQs
Custom timer for your Python coding pleasure
We found that code-timer 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
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.