关于OnTimer的疑问
Vars Global Integer timeID1; Global Integer timeID2; Events OnInit() { Print("当前时间:" + Text(SystemDateTime())); Numeric now_second = Value(Mid(Text(SystemDateTime()), 13, 2)); //当前秒数 Print("当前秒数:" + Text(now_second) + "," + "等待:" + Text(60 - now_second) + " 秒。"); timeID1 = CreateTimer((60 - now_second)*1000, 0, 1); //立即开始,只触发一次 timeID2 = CreateTimer(60000); //一直触发 print("aa"); } OnTimer(Integer id, Integer millsecs) { If (id == timeID1) { print("timeID1 运行完毕,当前时间: " + Text(SystemDateTime())); } If (id == timeID2) { Print("timeID2 运行完毕,当前时间: " + Text(SystemDateTime())); } }以下是输出信息:当前时间:20250512.110654561 当前秒数:54,等待:6 秒。 aa timeID1 运行完毕,当前时间: 20250512.110700587 timeID2 运行完毕,当前时间: 20250512.110754583 timeID2 运行完毕,当前时间: 20250512.110854585 timeID2 运行完毕,当前时间: 20250512.110954603老师您好,我的本意是每次运行策略时,都等到整点整分整秒时才运行,我的疑问是:当执行到 id == timeID1 时,是正常的,会等待 6 秒直至整分,而且它只会执行一次。但是不知为何,其中又等待了 54 秒,才会执行 id == timeID2 ?