Обычный таймер:
SUB(timer, $tim)
$time = $_time_t + $tim
WHILE($time > $_time_t)
WAIT(1)
$ts = $time-$_time_t
$th = 0
$tm = 0
while($ts > 3599)
INC($ts,-3600)
INC($th, 1)
end_cyc
while($ts > 59)
INC($ts,-60)
INC($tm, 1)
end_cyc
IF(STRLEN($th) < 2)
$th = STRCONCAT ("0", $th)
END_IF
IF(STRLEN($tm) < 2)
$tm = STRCONCAT ("0", $tm)
END_IF
IF(STRLEN($ts) < 2)
$ts = STRCONCAT ("0", $ts)
END_IF
LOGCLEAR
LOGWRITE ("Осталось: ",$th,":",$tm,":",$ts)
END_CYC
END_SUB
timer(300)
Вот обновление раз в 15 сек:
SUB(timer, $tim)
$time = $_time_t + $tim
WHILE($time > $_time_t)
$ts = $time-$_time_t
$th = 0
$tm = 0
while($ts > 3599)
INC($ts,-3600)
INC($th, 1)
end_cyc
while($ts > 59)
INC($ts,-60)
INC($tm, 1)
end_cyc
IF(STRLEN($th) < 2)
$th = STRCONCAT ("0", $th)
END_IF
IF(STRLEN($tm) < 2)
$tm = STRCONCAT ("0", $tm)
END_IF
IF(STRLEN($ts) < 2)
$ts = STRCONCAT ("0", $ts)
END_IF
LOGCLEAR
LOGWRITE ("Осталось: ",$th,":",$tm,":",$ts)
IF($time-$_time_t > 14)
WAIT(15)
ELSE
WAIT($time-$_time_t)
END_IF
END_CYC
END_SUB
timer(300)