def wrapper(*args, **kwargs): start = time.time() ret = func(*args, **kwargs) now = time.time() timeused = int((now - start) * 1000) lock = globl.get_value('lock') with lock: value = globl.get_value('value') value.append((now, timeused)) return ret
def pbar_get_size(): size = globl.get_value('pbar_value').value return size
def pbar_add_size(size): lock = globl.get_value('pbar_lock') with lock: globl.get_value('pbar_value').value += size
def force_exit(): return globl.get_value('force_exit').value
def part_faild(pid): return pid in globl.get_value('part_task_failed')
def sleep_over(): while globl.get_value('isflow_sleep').value: time.sleep(0.5) return True