https://github.com/jhyao/functime
Python module to time function.
https://github.com/jhyao/functime
Last synced: 5 months ago
JSON representation
Python module to time function.
- Host: GitHub
- URL: https://github.com/jhyao/functime
- Owner: jhyao
- License: mit
- Created: 2017-06-24T15:47:30.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-06-15T14:46:00.000Z (about 8 years ago)
- Last Synced: 2025-02-05T12:43:48.713Z (over 1 year ago)
- Language: Python
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# functime
## install
```
pip install functime
```
## usage
```python
import functime
func_time(sorted, [5,4,3,2,1])
```
out:
```
sorted AVG(1000000): 0.537999us
```
## api
This moudle provides a simple way to time a function.
* func_time(func, *args, **kwargs):
Time func with arguments.Run repeatedly with times set to (10, 100, 1000, ...) until the total time >= 0.2s. Print average run time with readable format.