0.1.168
This commit is contained in:
parent
4a806dfc6f
commit
6ec38a3e08
@ -1,7 +1,7 @@
|
||||
[metadata]
|
||||
# replace with your username:
|
||||
name = guan
|
||||
version = 0.1.167
|
||||
version = 0.1.168
|
||||
author = guanjihuan
|
||||
author_email = guanjihuan@163.com
|
||||
description = An open source python package
|
||||
|
@ -1,6 +1,6 @@
|
||||
Metadata-Version: 2.4
|
||||
Name: guan
|
||||
Version: 0.1.167
|
||||
Version: 0.1.168
|
||||
Summary: An open source python package
|
||||
Home-page: https://py.guanjihuan.com
|
||||
Author: guanjihuan
|
||||
|
@ -86,6 +86,15 @@ def run(function_name, *args, **kwargs):
|
||||
pass
|
||||
return return_data
|
||||
|
||||
# 使用该函数获取函数计算时间(秒)
|
||||
def timer(function_name, *args, **kwargs):
|
||||
import time
|
||||
start = time.time()
|
||||
result = function_name(*args, **kwargs)
|
||||
end = time.time()
|
||||
print(f"Running time of {function_name.__name__}: {end - start} seconds")
|
||||
return result
|
||||
|
||||
# 使用该函数实现 try except 结构
|
||||
def try_except(function_name, *args, **kwargs):
|
||||
try:
|
||||
|
Loading…
x
Reference in New Issue
Block a user