/*
*@更多基础不会的加autojs交流群553908361喽;版权属于群友
一键加群:点击加群
//黑马学府脚本资源网jiaoben.info更多源码发布
*
由群里小萌新提出,群友热心解答得出
run();
//实时显示脚本运行时长,并对返回的时长与设定的时长进行判断
function run() { //声明运行函数
threads.start(function() {
startTime = new Date().getTime();
while (true) {
runTime();
sleep(1000);
}
});
}
function runTime() {
var endTime = new Date().getTime();
var spendTime = Math.floor((endTime - startTime) / 1000);
log('已等待%d秒', spendTime);
let t = 3;
if (spendTime >= t) {
console.info("定时已结束");
exit();
}
}