You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
401 B
22 lines
401 B
5 years ago
|
import time
|
||
|
|
||
|
from config.config import init
|
||
|
from config.config import logger
|
||
|
|
||
|
start = int(time.time())
|
||
|
init()
|
||
|
|
||
|
def getRunTimeInt():
|
||
|
return (int(time.time()) - start)
|
||
|
|
||
|
def getRunTime():
|
||
|
return '程序已经执行%d秒' % (int(time.time()) - start)
|
||
|
|
||
|
|
||
|
def writeInfo(msg):
|
||
|
logger.info('%s\t(%s)' % (msg, getRunTime()))
|
||
|
|
||
|
|
||
|
def writeError(msg):
|
||
|
logger.error('%s\t(%s)' % (msg, getRunTime()))
|