import { log } from "./utils.uts"; type TimerOptions = { start: (res: string) => void; work: (res: string) => void; }; export function doTimerTask(opts:TimerOptions) { opts.start('doTimerTask start'); setTimeout(function() { opts.work("doTimerTask work"); }, 2000); return { name: "doTimerTask" }; } export function doIntervalTask(opts:TimerOptions) { var taskRet = setInterval(function() { opts.work("doIntervalTask work"); }, 2000); opts.start('doIntervalTask start'); return { name: "doIntervalTask",taskId:taskRet}; }