Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Readme
Requires Python >= 3.10
TimeProfiler makes use of new features from Python's typing module.
pip install timer-module
import time
from timer_module import TimerModule
timer_module = TimerModule().start()
timer_module.pause()
time.sleep(0.2)
timer_module.start()
time.sleep(0.5)
seconds = timer_module.get_time()
print(seconds)
# Seconds
TimerModule().get_time() # float
# Milliseconds
TimerModule().get_time_ms() # float
# Nanoseconds
TimerModule().get_time_ns() # float
# Seconds
TimerModule().set_time(1.0)
# Milliseconds
TimerModule().set_time_ms(1.0)
# Nanoseconds
TimerModule().set_time_ns(1.0)
TimerModule().pause()
TimerModule().refresh()
TimerModule().reset()
TimeProfiler also includes a "function_profiler" and "async_function_profiler", in a class the asynchronous methods are handled automatically, but for functions you need to select the appropriate decorator.
import time
from timer_module import TimeProfiler
# You only need this line to profile the entire class
# The program is run normally, this decorator will wrap
# The class and its methods in order to track execution time
@TimeProfiler().class_profiler
class ExampleClass:
def __init__(self):
time.sleep(0.1)
def method_1(self):
time.sleep(0.5)
self.method_2()
def method_2(self):
time.sleep(1)
self.method_3()
def method_3(self):
time.sleep(1)
self.method_4()
def method_4(self):
time.sleep(0.1)
self.method_5()
def method_5(self):
time.sleep(0.1)
ec = ExampleClass()
ec.method_1()
FAQs
Timer Module with performance profiling features
We found that timer-module 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
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).