快速登录:  

Forum: General Discussion

话题: limit of repeat_start?
Hi all,

I was messing around with repeat_start loops and made this snippet of script to try and find the absolute limit of how fast a repeat_start loop can actually loop.

set_var $delay 33ms & set_var '$peak' -1 & set_var '$counter' 0 & repeat_start_instant 'bigwait' 150000ms & repeat_stop 'lilwait' & param_equal `get_var "$counter"` `get_var "$peak"` ? repeat_stop 'bigwait' : set_var '$peak' `get_var "$counter"` & set_var '$counter' 0 & set_var '$delay' `get_var "$delay" & param_add -1` & repeat_start 'lilwait' `get_var "$delay"` & set_var '$counter' `get_var "$counter" & param_add 1`

Testing shows that if you give repeat_start 1500 seconds to loop as many times as possible, it cannot loop more than ~4545 times, giving you a minimum effective delay of just over 33ms per loop. The script above will keep reiterating well past $delay=33ms because, especially over larger time periods, $peak values tend to be more sporadic, leaving it up to chance for subsequent $peak values to match. Usually, the script will stop itself between $delay=29 and 31ms, but I've run it as low as 21ms. In every case, however, $peak values still result in a minimum effective delay of just over 33ms, even when the $delay value doesn't match up.

Does anyone know if this 33ms limit can be broken, if it relies on the code inside the loop, or anything else? Is there a faster way to repeat things in VDJ script?
 

发表时间 Wed 04 Jan 23 @ 2:34 am
locoDogPRO InfinityModeratorMember since 2013
33ms was my finding too, it can on some repeats be faster but it all averages out to 33ms

could you do something with brackets and wait to have 2 instances of a repeat spaced 16ms apart? maybe, I don't know. 30 repeats per second seems to be enough for most cases.

I have wanted zero time repeats but that was for something that just does a thing and didn't rely on monitoring anything.
 

发表时间 Wed 04 Jan 23 @ 6:52 am
locoDogPRO InfinityModeratorMember since 2013
oh erm virtual fx has a once per buffer script call, so that you're talking ~5ms
 

发表时间 Wed 04 Jan 23 @ 6:55 am