Appearance
为函数添加超时功能。
function <T extends (...args: any) => any>(fun: () => any, time: number = 1000): Promise<T>