File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 2525# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2626# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2727
28- import sys
28+ import sys , getopt
29+ import math
30+ from time import sleep
2931
3032from .contrib .objgraph import show_most_common_types
3133
@@ -116,7 +118,12 @@ def main_func():
116118 tcfg .continuous = True
117119 continue
118120 if o == '-C' :
119- tcfg .cps = float (a )
121+ if not a .startswith ('=' ):
122+ cpsval = float (a )
123+ tcfg .cps = lambda now : cpsval
124+ else :
125+ cpsfunc = eval (F'lambda now: { a [1 :]} ' )
126+ tcfg .cps = cpsfunc
120127 continue
121128 if len (ttype ) > 0 :
122129 tcfg .ttype = tuple (ttype )
Original file line number Diff line number Diff line change 3030from sippy .SipTransactionManager import SipTransactionManager
3131from sippy .Signal import Signal
3232from sippy .Time .Timeout import Timeout , TimeoutAbsMono
33- from sippy .Time .MonoTime import MonoTime
3433from sippy .Core .EventDispatcher import ED2
3534from sippy .Math .recfilter import recfilter
3635from random import shuffle , choice
@@ -170,7 +169,7 @@ def runnext(self):
170169 subtest = subtest_cfg .init_test ()
171170 self .nsubtests_running += 1
172171 if self .tcfg .cps != None :
173- self .ntime .offset (1.0 / self .tcfg .cps )
172+ self .ntime .offset (1.0 / self .tcfg .cps ( self . ntime - self . tcfg . ntime ) )
174173 self .nextr = TimeoutAbsMono (self .runnext , self .ntime )
175174 else :
176175 self .runnext ()
You can’t perform that action at this time.
0 commit comments