ianlini / bistiming Goto Github PK
View Code? Open in Web Editor NEWA logging-friendly stopwatch and profiling tool for Python.
Home Page: https://bistiming.readthedocs.io
License: MIT License
A logging-friendly stopwatch and profiling tool for Python.
Home Page: https://bistiming.readthedocs.io
License: MIT License
Add a new instance variable cumulative_elapsed_time
, and implement a new function like this:
timer = SimpleTimer()
with timer:
sleep(1)
sleep(1)
with timer:
sleep(1)
print(timer.elapsed_time) # 1 second
print(timer.cumulative_elapsed_time) # 2 second
It will be useful when we want to evaluate the time of some block of code in a loop.
try to import pandas and return pd.DataFrame(self.get_statistics())
Use some tools to print a table.
Currently, we only support the context manager style (with-block). Sometimes, we need to explicitly start or stop the timer.
maybe using __call__
Those methods just make the same call to all of the items in MultiStopwatch
using _
prefix
Rewriting will cause some bad effects when the line is longer than the terminal width
Inherit from the built-in list
.
MultiStopwatch(n)
builds n
Stopwatch
at once, and we can use them to evaluate each code segment.
After running, we can have some statistics like in line_profiler.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.