v:\> type dowtest.btm:functions.btm
function fatica4 `%@instr[%1,1,01000001]`
function kachupp `%@index[17,%1,0]`
function fatica2 `%@eval[1-(301 MOD %1)]`
function fatica3 `%@eval[abs(%1-4)\3]`
function fatica1 `%@if[%1==1 .OR. %1==7,1,0]`
function caverly `%@if[%@eval[%1 mod 6] == 1,1,0]`
function fatica5 `%@regex[[17],%1]`
v:\> type dowtest.btm
setlocal
call %0:functions.btm
on break (timer /q off & quit)
echo ^r^nTiming 10,000 iterations, each with a random (1-7) weekday ...^r^n
do line_no=0 to %@lines[%0:functions.btm]
setdos /x-47
set line=%@line[%0:functions.btm,%line_no]
echos %@format[-50,%line]^s^s
set func=%%@%@word[1,%line]
setdos /x+47
timer /q on
(do i=1 to 10000 (echos %func[%@random[1,7]])) > NUL
::do i=1 to 10000 (noop %func[%@random[1,7]])
echo %@timer[1,s] s
enddo
timer /q off
v:\> dowtest.btm
Timing 10,000 iterations, each with a random (1-7) weekday ...
function fatica4 `%@instr[%1,1,01000001]` 2.471 s
function kachupp `%@index[17,%1,0]` 2.460 s
function fatica2 `%@eval[1-(301 MOD %1)]` 2.830 s
function fatica3 `%@eval[abs(%1-4)\3]` 2.959 s
function fatica1 `%@if[%1==1 .OR. %1==7,1,0]` 3.223 s
function caverly `%@if[%@eval[%1 mod 6] == 1,1,0]` 3.256 s
function fatica5 `%@regex[[17],%1]` 2.493 s